图片随鼠标滑轮滚动变大变小,最大不超过屏幕宽度-360
*/
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>onMouseWheel Event Sample</TITLE>
<SCRIPT>
var count = 10;
var oCounter = '100%'
function Picture(obj,valuestr)
{
count = Counting(count);
Resize(obj,count,valuestr);
return false;
}
function Counting(count){
if (event.wheelDelta >= 120)
count++;
else if (event.wheelDelta <= -120)
count--;
return count;
}
function Resize(obj,count,maxvalues){
if (obj.width*parseFloat(oCounter)/100 <= maxvalues || count <= parseFloat(oCounter)/10)
{
obj.style.zoom = count + '0%';
oCounter = count + '0%';
}
else
{
count = parseFloat(oCounter)/10 - 1
}
}
</SCRIPT>
</HEAD>
<BODY>
<div width="500">
<img src="http://www.wenzhou98.com/bbs/images/logo.gif" onmousewheel="return Picture(this,screen.width-360);" >
</div>
<input type="button" name="go" value="go" οnclick="alert(oImage.height);">
<br>
<br>
<br>
<A HREF="http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmousewheelEX.htm" target="_blank">http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmousewheelEX.htm</A>.
</BODY>