一.在headinclude中添加javascript代码
<script language=javascript>
function paimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;}
</script>
function paimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;}
</script>
当然你也可以把他放到js文件中,再导入。
二.打开html模式,找到你所添加的图片代码<img src=...>。例如
修改前:
www.444p.com
找到原来的图片代码 www.444p.com
<IMG alt="这幅图没有缩放效果" hspace=0
src="http://www.city521.com/201/style/in_img.jpg" align=baseline border=0>
src="http://www.city521.com/201/style/in_img.jpg" align=baseline border=0>
看看对比一下代码,知道了其中奥秘了吗,当然其中的参数可以根据自己的需要修改。 www.444p.com php学习之家
<IMG onmousewheel="return paimg(this)" style="CURSOR: pointer" onclick=javascript:window.open(this.src);
onload="javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;" hspace=0
src="http://www.city521.com/201/style/in_img.jpg" align=baseline border=0>
onload="javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;" hspace=0
src="http://www.city521.com/201/style/in_img.jpg" align=baseline border=0>
















