鼠标滑轮控制图片大小 - java教程,javascript教程-
时间:2010-08-28 来源:深圳的天空
鼠标滑轮控制图片大小
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>鼠标滑轮控制图片大小练习</title>
<script language="JavaScript" type="text/javascript">
function changeImg(obj){
var zoom = parseInt(obj.style.zoom,10)||100;
zoom += event.wheelDelta/10;
if(zoom > 0) obj.style.zoom = zoom + '%';
return false;
}
</script>
</head>
<body>
<img src="http://www.shaoqun.com/images/logo.gif" onmousewheel="return changeImg(this)" />
</body>
</html>