移动鼠标放大缩小图片

来源:互联网 发布:光学测量软件 编辑:程序博客网 时间:2024/04/28 00:54
<html>
<head>
<title>鼠标移动放大图片</title>
</head>
<body>
<input NAME="images1" TYPE="image" ID="images1" SRC="http://www.codefans.net/jscss/demoimg/wall_s6.jpg" ALIGN="MIDDLE" BORDER="0"  onMouseMove="move()" onMouseOut="out()">
<script language="javascript">
var w=images1.width;
var h=images1.height;
images1.height = Math.floor(h*0.7);
images1.width = Math.floor(w*0.7);
function move()
{
images1.height = h;
images1.width = w;
}
function out()
{
images1.height = Math.floor(h*0.7);
images1.width = Math.floor(w*0.7);
}
</script>
</body>
</html>
0 0
原创粉丝点击