鼠标经过图片变大代码

来源:百度知道 编辑:UC知道 时间:2024/07/04 10:04:02
<a rel="images/08081201001.jpg" title="Myselves" href="http://xxxxxxx">who I am</a>
怎么把这个链接的图片当鼠标经过时变大,鼠标移走时变小,可以插入函数,怎么样插入呢

JS写

在图片上加属性
onmouseover="ZoomImage(this,'big');"
onmouseout ="ZoomImage(this,'small');"

<script>
functin ZoomImage(obj,val)
{
if(val == "big")
{
document.all.obj.style.width = "100px";【这里写你要的大小】
document.all.obj.style.height = "100px";
}
else
{
document.all.obj.style.width = "50px";【这里写你要的大小】
document.all.obj.style.height = "50px";
}
}
</script>

类似这样了
你试试