jquery滚轮实现图片缩放
2011-12-17 02:18
267 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.6.2.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 (1).jpg"/>
</center>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.6.2.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 (1).jpg"/>
</center>
</body>
</html>
相关文章推荐
- jQuery实现的鼠标滚轮控制图片缩放功能实例
- jQuery 鼠标滚轮实现图片缩放
- jquery 鼠标滚轮实现图片缩放
- jquery实现根据浏览器窗口大小自动缩放图片的方法
- jQuery实现等比例缩放大图片
- jquery实现图片按比例缩放示例
- 【前端开发实例】JS CSS - 鼠标滚轮实现图片缩放 -(五)
- 用滚轮实现图片缩放
- jQuery实现等比例缩放大图片
- 在C#中实现图片缩放(含asp.net用鼠标滚轮实现图片缩放)
- jQuery实现按比例缩放图片
- jquery获取select中的option的text值|| PHP图片缩放函数:实现等比例不失真缩放
- 用滚轮实现图片缩放
- 利用鼠标滚轮实现图片缩放
- 基于JQuery实现的图片自动进行缩放和裁剪处理
- 使用jQuery实现指定图片按比例缩放
- jQuery实现等比例缩放大图片
- jQuery实现按比例缩放图片
- jQuery实现按比例缩放图片
- jQuery实现等比例缩放大图片让大图片自适应页面布局