2004/08/12 | 鼠标滚轮放大/缩小图片
类别(JScript) | 评论(0) | 阅读(124) | 发表于 10:43
<script language="javascript">
function zoomImg(img){
var zoom=parseInt(img.style.zoom,10) || 100;
zoom += event.wheelDelta / 12;
if (zoom>10 && zoom<400) img.style.zoom = zoom + "%";
return false;
}

function document.onmousewheel(){
    if(event.wheelDelta==120){
        d.value="向前滚"
    }
    else{
        d.value="向后滚"
    }
}
</script>
<img src="http://www.blueidea.com/gg/qq/2.jpg" alt="鼠标滚轮放大/缩小图片" onmousewheel="return zoomImg(this)">
<input type="text" size=40 name=d>
0

评论Comments

日志分类
首页[102]
.Net[11]
VBScript[1]
JScript[51]
XML[3]
HTML&CSS[9]
ASP[8]
ActiveX[4]
Software[10]
Other[5]