javascript的图片缩放...
时间:2010-08-19 来源:zhuyi412546724
现在许多网站上都有图片的自由放大和缩小功能。
<HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <TITLE>onMouseWheel</TITLE> <SCRIPT> var count = 10; function Picture() { count = Counting(count); Resize(count); return false; } function Counting(count){ if (event.wheelDelta >= 120) count++; else if (event.wheelDelta <= -120) count--; return count; } function Resize(count){ oImage.style.zoom = count + '0%'; oCounter.innerText = count + '0%'; } </SCRIPT> </HEAD> <BODY> <div align=center> <span style="font-weight:bold" mce_style="font-weight:bold">Size = <span id="oCounter" style="color:red;" mce_style="color:red;">100%</span></span> <img id="oImage" src="images/aaa.gif" mce_src="images/aaa.gif" onmousewheel="return Picture();" > </div> </BODY> </HTML>
解决问题的方法和途径很多。欢迎交流,QQ: 412546724