218、鼠标滚动控制大小

218、鼠标滚动控制大小

<head>

<meta http-equiv="Content-Language" content="zh-cn" />

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<meta name="robots" content="all" />

<title>用鼠标滚轮滚动控制图片显示的大小</title>

<script language="javascript">

function bbimg(o){

       var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';

       return false;

}

</script>

</head>

 

<body>

 

<p>将鼠标放在图片上,然后滚动鼠标滚轮试试看</p>

<p>

<img border="0" src="sto/1006.jpg" onmousewheel="return bbimg(this)"></p>

<p> </p>

<p> </p>

<p> </p>

 

</body>

 

</html>

 

Write a comment

Comments: 0