用css中的zoom属性可以让网页实现IE7中的放大缩小功能。
比如你想让你的网页缩小为原来的一半,那么就在body中加入style="zoom:0.5",如:
程序代码
<body style="zoom:0.5">
鼠标滚轮程序以及CSS的zoom属性范例
2008年04月10日 星期四 09:54
<img src=pp.jpg' onmousewheel='alert("滚轮值"+event.wheelDelta)' οnclick='this.style.zoom=parseInt(this.style.zoom)+1' οncοntextmenu='this.style.zoom=parseInt(this.style.zoom)-1;return false'id=a style='position:absolute;zoom:1' title='左键单击放大1倍,右键单击缩小1倍,鼠标滚轮控制'>
<script> top1=0; function document.onmousewheel(){ if(event.wheelDelta>0)top1-=10;else top1+=10 a.style.top=top1 } </script> |