<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://HdhCmsTestw3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://HdhCmsTestw3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HdhCmsTestgxlcms测试数据 鼠标滚轮控制图片缩放</title> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript"> $(function() { function zoomImg(o) { var zoom = parseInt(o.style.zoom, 10) || 100; zoom += event.wheelDelta / 2; //可适合修改 if (zoom > 0) o.style.zoom = zoom + '%'; } $(document).ready(function() { $("img").bind("mousewheel", function() { zoomImg(this); return false; }); }); }) </script> </head> <body> <center> <img src="1.jpg"/> </center> </body> </html>
运行效果:
相关推荐:
jQuery图片缩放插件smartZoom使用方法分享
PHP图片处理之使用imagecopyresampled函数实现图片缩放例子
php图片缩放实现方法_PHP教程
以上就是jQuery实现鼠标滚轮控制图片缩放的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于jQuery实现鼠标滚轮控制图片缩放的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did71606