<script>
function on_mousewheel()
{
var o = event.srcElement
if(o.tagName == 'IMG' &&o.offsetWidth >320)
{
var zoom=parseInt(o.style.zoom, 10)||100
zoom+=event.wheelDelta/20
if (zoom>0) o.style.zoom=zoom+'%'
return false
}
return true
}
document.onmousewheel = on_mousewheel</script>
BLOG里你可能无法禁止.
html更改图片滚动的图片大小,可以通过js不断的更改图片的尺寸来实现,实例如下:
<div id="Demo_t0" style="overflow:hiddenwidth:730height:182"><table width=" 0" height="136" border=0 align=center cellpadding=0 cellspacing="0" cellspace=0>
<tr>
<td align="center" valign=top id=Demo_t1><table width=" 0" height="136" border=0 align=left cellpadding=0 cellspacing="0" cellspace=0>
<tr>
<td width=" 0" align="center" valign="middle">滚动内容</td>
</tr>
</table></td>
<td width="1" valign=top id=Demo_t2></td>
</tr>
</table>
</div>
<script language="javascript">
var Demo_speed=30
Demo_t2.innerHTML=Demo_t1.innerHTML
function Demo_Marquee(){
if(Demo_t2.offsetWidth-Demo_t0.scrollLeft<=0)
Demo_t0.scrollLeft-=Demo_t1.offsetWidth
else{
Demo_t0.scrollLeft++
}
}
var Demo_MyMar=setInterval(Demo_Marquee,Demo_speed)
Demo_t0.onmouseover=function() {clearInterval(Demo_MyMar)}
Demo_t0.onmouseout=function() {Demo_MyMar=setInterval(Demo_Marquee,Demo_speed)}
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)