转载jQuery图片放大插件[twiPicZoom]
双击查看大图,鼠标滚动放大缩小,能够切换到上一张和下一张,点击右上角关闭,兼容主流的浏览器。
截图效果:
(例子一效果)
(例子二效果:注,如果第一张的时候,左侧就不会显示前一张箭头,最后一张类似)
如何使用:(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
转载jQuery图片放大插件[twiPicZoom]的更多相关文章
- jquery图片放大插件鼠标悬停图片放大效果
都知道jquery都插件是非常强大的,最近分享点jquery插件效果,方便效果开发使用. 一.HTML代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHT ...
- 一款简单实用的jQuery图片画廊插件
图片画廊 今天分享一个自己实现的jQuery 图片画廊插件. 看一下效果图: 点击图片时: 在线演示地址:http://www.jr93.top/photoGallery/photoGallery.h ...
- 十个jQuery图片画廊插件推荐
jQuery的画廊插件可以将分组图像和多媒体资料转成类似Flash的图像或照片.当幻灯片已经成为网站的重要组成部分,jQuery的重要性不能被忽视.下面为你介绍了10个最有美感,创新性和创造性的jQu ...
- 推荐几款jquery图片切换插件
一.前言 毕业季到了,大家都在匆匆忙忙的记录大学里最美好的时光,照片中各种花式.各种姿势都涌现出来了.这么多的照片怎么展示出来给自己的好友看呢?有人选择做成视频,有人选择ps之后做成图片集,而我选择利 ...
- Cropper – 简单的 jQuery 图片裁剪插件
Cropper 是一个简单的 jQuery 图像裁剪插件.它支持选项,方法,事件,触摸(移动),缩放,旋转.输出的裁剪数据基于原始图像大小,这样你就可以用它们来直接裁剪图像. 如果你尝试裁剪跨域图像, ...
- 分享22款响应式的 jQuery 图片滑块插件
响应式(Responsive)设计的目标是要让产品界面能够响应用户的行为,根据不同终端设备自动调整尺寸,带给用户良好的使用体验.这篇文章收集了22款优秀的响应式 jQuery 幻灯片插件,它们能够帮助 ...
- 【精心推荐】12款很好用的 jQuery 图片滚动插件
这里收集了12款很好用的 jQuery 图片滚动插件分享给大家.jQuery 作为最流行的 JavaScript 框架,使用简单灵活,同时还有许多优秀的插件可供使用.其中最令人印象深刻的应用之一就是各 ...
- Croppic – 免费开源的 jQuery 图片裁剪插件
Croppic 这款开源的 jQuery 图片裁剪插件能够满足网站开发人员各种不同的使用需要.只需要简单的上传图片,就可以实现你想要的图像缩放和裁剪功能.因为使用了 HTML5 FormData 对 ...
- jQuery图片延迟加载插件jQuery.lazyload
插件描述:jQuery图片延迟加载插件jQuery.lazyload,使用延迟加载在可提高网页下载速度.在某些情况下,它也能帮助减轻服务器负载. 使用方法 引用jquery和jquery.lazy ...
随机推荐
- [Kerberos] How to Kerberize an Hadoop Cluster
Overview Kerberos是一个第三方认证机制,用户和服务(known as principals)通过kerberos server (known as the Key Distributi ...
- shell简单使用
最近需要用到shell脚本实现关机保护作用,总结下语法 要点: 1.linux下编写的shell脚本不能在window下编写,否则会出现^M的错误,用window编写保存,在linux用vim打开,每 ...
- 网络编程1-TCP编程(socket)
1 如何实现网络中的主机相互通信 一定的规则,有两套参考模型 (1)osi参考模型,过于理想化,未能在互联网上推行 osi有七层 (2)tcp/ip参考模型,有四层,各层之间通过不同的网络协议传输数据 ...
- Lua模块测试
Lua模块 ---------------------------------------------------------- ----------------------- 模块测试module_ ...
- iOS开发——UI进阶篇(十一)应用沙盒,归档,解档,偏好设置,plist存储,NSData,自定义对象归档解档
1.iOS应用数据存储的常用方式XML属性列表(plist)归档Preference(偏好设置)NSKeyedArchiver归档(NSCoding)SQLite3 Core Data 2.应用沙盒每 ...
- c++ 操作符重载和友元
操作符重载(operator overloading)是C++中的一种多态,C++允许用户自定义函数名称相同但参数列表不同的函数,这被称为函数重载或函数多态.操作符重载函数的格式一般为: operat ...
- 他们在军训,我在搞 OI(Ending)
Day 7 上午看看数学书,老师让我把导数相关的概念学了.这也没有多高大上,就是一坨公式需要背,什么 (a)' = 0 啦,什么 (xn)' = n·xn-1 啦,什么 sin'(x) = cos(x ...
- Attempt to present <vc> on <vc> which is already presenting <vc>/(null)
在给 tableViewCell 添加长按手势弹出一个 popViewController 的时候,遇到的这个变态问题: Warning: Attempt to present <UINavig ...
- 160809209_李梦鑫_C语言程序设计实验2 选择结构程序设计
实验2-1 输入3个数,并按由大到小的顺序输出. 实验要求: 编写一个C程序,输入3个数,并按由大到小的顺序输出. 源码:#include <stdio.h> int main() { i ...
- 11.5---含有空字符串的字符串查找(CC150)
注意,1,"" 和 " ".是不同的,空字符串指的是"": 2,注意String的compareTo.小于是指<0.并不是==-1: ...