<HTML>
<script>
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
event.srcElement.parentNode.childNodes(0).value=image.width;
event.srcElement.parentNode.childNodes(1).value = image.height;
if(image.width>120 || image.height>150){
flag=true;
if(image.width/image.height>= 100/200){
if(image.width>120){
ImgD.width=100;
ImgD.height=(image.height*100)/image.width;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
}
if(image.height>150){
ImgD.height=100;
ImgD.width=(image.width*100)/image.height;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt="点击后在新窗口打开...";
}
}
}
function show01()
{
var span01 = document.getElementById("span01");
var bigimg = document.getElementById("bigimg");
//var v = document.getElementById("v");
//v.style.width = 200+"px";
//v.style.height = 200+"px";
bigimg.src=event.srcElement.src;
bigimg.width = event.srcElement.parentNode.childNodes(0).value;
bigimg.height = event.srcElement.parentNode.childNodes(1).value;
span01.style.top = event.y;
span01.style.left = event.x;
span01.style.display = "block";
}
function hide()
{
var span01 = document.getElementById("span01");
span01.style.display = "none";
}
</SCRIPT>
<BODY>
<img οnmοuseοut='hide();' οnmοuseοver='show01();' οnlοad='javascript:DrawImage(this);' alt="图片附加文字"src="http://img1.mpdaogou.com/2007/4/29/8b33f3aa-7d0a-47ea-9b55-02180ec325f7.jpg" width="150" height="150"/>
<span id="span01" style="display:none;position:absolute;top:10;left:10">
<img id="bigimg" src=""/>
</span>
</BODY>
</HTML>