// CTR+滚动鼠标滚轴,缩放图片大小
<script language="JavaScript">
function imgzoom(o) {
if(event.ctrlKey)
{
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom -= event.wheelDelta / 12;
if(zoom > 0) {
o.style.zoom = zoom + '%';
}
return false;
}
else
{
return true;
}
}
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>
用法: <img src="163askLogo.gif" width="154" height="80" onmousewheel="return imgzoom(this);" />
//只是滚动鼠标滚轴,缩放图片大小
用法:<IMG onmousewheel="return bbimg(this)" src="imgsrc" border=0/>