转载jQuery图片放大插件[twiPicZoom]
2014-07-23 12:49
483 查看
转载http://xuzhihong1987.blog.163.com/blog/static/26731587201312821725913/
功能说明:
双击查看大图,鼠标滚动放大缩小,能够切换到上一张和下一张,点击右上角关闭,兼容主流的浏览器。
截图效果:
(例子一效果)
[b]
[/b]
(例子二效果:注,如果第一张的时候,左侧就不会显示前一张箭头,最后一张类似)
如何使用:(include)
1、样式 twiPicZoom.css
2、jQuery的类库,不一定要用1.8.3,其他的版本也行。
3、鼠标滚动放大缩小需要用到 jquery.mousewheel.js
4、核心 jquery.twiPicZoom.js
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
在代码中对选择的对像直接使用twiPicZoom()方法。
$(function () {
$('img[type="twiPicZoom"]').twiPicZoom();
});
例子1:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
<title>查看图片大图</title>
<script type="text/javascript">
$(function () {
$('img[type="twiPicZoom"]').twiPicZoom();
});
</script>
</head>
<body>
<div id="imgContainer">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Desert.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Hydrangeas.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Lighthouse.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Jellyfish.jpg" type="twiPicZoom"/>
</div>
</body>
</html>
例子2:(复杂的结构,选择的不是图片对象,也可配置属性)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
<title>查看图片大图/更改配置</title>
<script type="text/javascript">
$(function () {
$('div[type="twiPicZoom"]').twiPicZoom({srcField:'href'});
});
</script>
<style type="text/css">
#imgContainer div
{
display:inline-block;
}
</style>
</head>
<body>
<div id="imgContainer">
<div type="twiPicZoom" href="../../samplePictures/Desert.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Desert.jpg" />
<h2>Desert</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Hydrangeas.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Hydrangeas.jpg"/>
<h2>Hydrangeas</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Lighthouse.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Lighthouse.jpg"/>
<h2>Lighthouse</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Jellyfish.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Jellyfish.jpg"/>
<h2>Jellyfish</h2>
</div>
</div>
</body>
</html>
源码下载地址:
twiPicZoom 1.0:http://www.kuaipan.cn/file/id_50389080302682261.htm
功能说明:
双击查看大图,鼠标滚动放大缩小,能够切换到上一张和下一张,点击右上角关闭,兼容主流的浏览器。
截图效果:
(例子一效果)
[b]
[/b]
(例子二效果:注,如果第一张的时候,左侧就不会显示前一张箭头,最后一张类似)
如何使用:(include)
1、样式 twiPicZoom.css
2、jQuery的类库,不一定要用1.8.3,其他的版本也行。
3、鼠标滚动放大缩小需要用到 jquery.mousewheel.js
4、核心 jquery.twiPicZoom.js
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
在代码中对选择的对像直接使用twiPicZoom()方法。
$(function () {
$('img[type="twiPicZoom"]').twiPicZoom();
});
例子1:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
<title>查看图片大图</title>
<script type="text/javascript">
$(function () {
$('img[type="twiPicZoom"]').twiPicZoom();
});
</script>
</head>
<body>
<div id="imgContainer">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Desert.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Hydrangeas.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Lighthouse.jpg" type="twiPicZoom"/>
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Jellyfish.jpg" type="twiPicZoom"/>
</div>
</body>
</html>
例子2:(复杂的结构,选择的不是图片对象,也可配置属性)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../twiPicZoom/twiPicZoom.css" rel="stylesheet" type="text/css" />
<script src="../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.mousewheel.js" type="text/javascript"></script>
<script src="../../twiPicZoom/jquery.twiPicZoom.js" type="text/javascript"></script>
<title>查看图片大图/更改配置</title>
<script type="text/javascript">
$(function () {
$('div[type="twiPicZoom"]').twiPicZoom({srcField:'href'});
});
</script>
<style type="text/css">
#imgContainer div
{
display:inline-block;
}
</style>
</head>
<body>
<div id="imgContainer">
<div type="twiPicZoom" href="../../samplePictures/Desert.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Desert.jpg" />
<h2>Desert</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Hydrangeas.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Hydrangeas.jpg"/>
<h2>Hydrangeas</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Lighthouse.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Lighthouse.jpg"/>
<h2>Lighthouse</h2>
</div>
<div type="twiPicZoom" href="../../samplePictures/Jellyfish.jpg">
<img style="width:160px;height:120px;" alt="" src="../../samplePictures/Jellyfish.jpg"/>
<h2>Jellyfish</h2>
</div>
</div>
</body>
</html>
源码下载地址:
twiPicZoom 1.0:http://www.kuaipan.cn/file/id_50389080302682261.htm
相关文章推荐
- [原]ZoomImage 中文版汉化说明 jQuery图片浏览放大插件
- 图片放大编辑的jQuery插件
- 一张图片 点击鼠标放大,再点缩小 ( 基于jquery1.8.3), 另外推荐一款插件:lightBox...效果不错。
- 基于jQuery的图片相册滑出放大插件
- 自写图片遮罩层放大功能jquery插件源码,photobox.js 1.0版,不兼容IE6
- jQuery图片放大预览插件 cloud-zoom
- jquery插件珍藏(图片局部放大/信息提示框)
- jQuery 图片放大预览插件
- jquery实现图片延时加载插件【多处转载】
- 一款基于jQuery可放大预览的图片滑块插件
- 来自国外的14个图片放大编辑的jQuery插件整理
- 【转载】【精心推荐】10款非常时尚的 jQuery 图片切换插件
- 图片局部放大插件-jquery.jQZoom.js
- jquery插件图片放大显示插件lightBox2.6最新版
- jQuery chili图片远处放大插件
- 来自国外的14个图片放大编辑的jQuery插件整理
- jQuery-图片上传裁剪插件--imgAreaSelect(分析一) 放大缩小
- Jquery 插件图片放大效果(兼容ie 火狐 谷歌 Safari)
- 自写图片遮罩层放大功能jquery插件源代码,photobox.js 1.0版,不兼容IE6
- jquery制作图片放大显示插件Lightbox2.6图片相册