[转]jquery 鼠标放在图片上显示图片的放大镜效果jqzoom_ev-2.3
本文转自:http://blog.csdn.net/weizengxun/article/details/6768183
鼠标放在图片上显示图片的放大镜效果使用jqzoom实现,本例版本2.3
效果图一
效果图二
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" http://www.w3.org/TR/html4/loose.dtd>
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head>
- <title>JQzoom 2 Demo</title>
- <script src="../js/jquery-1.6.js" type="text/javascript"></script>
- <script src="../js/jquery.jqzoom-core.js" type="text/javascript"></script>
- <link rel="stylesheet" href="../css/jquery.jqzoom.css" type="text/css">
- <style type"text/css">
- body{margin:0px;padding:0px;font-family:Arial;}
- a img,:link img,:visited img { border: none; }
- table { border-collapse: collapse; border-spacing: 0; }
- :focus { outline: none; }
- *{margin:0;padding:0;}
- p, blockquote, dd, dt{margin:0 0 8px 0;line-height:1.5em;}
- fieldset {padding:0px;padding-left:7px;padding-right:7px;padding-bottom:7px;}
- fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
- dl dd{margin:0px;}
- dl dt{}
- .clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden;}
- .clearfix{display:block;zoom:1}
- ul#thumblist{display:block;}
- ul#thumblist li{float:left;margin-right:2px;list-style:none; text-align:center;height:80px; line-height:80px; width:100px;overflow:hidden;}
- ul#thumblist li a{display:block;border:1px solid #CCC;height:78px; line-height:78px; width:98px;overflow:hidden;}
- ul#thumblist li a.zoomThumbActive{
- border:1px solid red;height:78px; line-height:78px; width:98px;overflow:hidden;
- }
- ul#thumblist li img{ height:80px;}
- .jqzoom{
- text-decoration:none;
- float:left;
- }
- </style>
- <script type="text/javascript">
- //使用方法
- $(document).ready(function() {
- $('.jqzoom').jqzoom({
- zoomType: 'innerzoom',
- lens:true,
- preloadImages: true,
- alwaysOn:false
- });
- });
- </script>
- </head>
- <body>
- <div class="clearfix" id="content" style="margin-top:100px;margin-left:350px; height:500px;width:500px;" >
- <div class="clearfix">
- <a href="imgProd/triumph_big1.jpg" class="jqzoom" rel='gal1' title="triumph" >
- <img src="imgProd/triumph_small1.jpg" title="triumph" style="border: 1px solid #666;">
- </a>
- </div>
- <br/>
- <div class="clearfix" >
- <ul id="thumblist" class="clearfix" >
- <li><a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small1.jpg',largeimage: './imgProd/triumph_big1.jpg'}"><img src='imgProd/thumbs/triumph_thumb1.jpg'></a></li>
- <li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small2.jpg',largeimage: './imgProd/triumph_big2.jpg'}"><img src='imgProd/thumbs/triumph_thumb2.jpg'></a></li>
- <li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small3.jpg',largeimage: './imgProd/triumph_big3.jpg'}"><img src='imgProd/thumbs/triumph_thumb31.jpg'></a></li>
- </ul>
- </div>
- </div>
- </body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" http://www.w3.org/TR/html4/loose.dtd>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>JQzoom 2 Demo</title>
<script src="../js/jquery-1.6.js" type="text/javascript"></script>
<script src="../js/jquery.jqzoom-core.js" type="text/javascript"></script> <link rel="stylesheet" href="../css/jquery.jqzoom.css" type="text/css">
<style type"text/css"> body{margin:0px;padding:0px;font-family:Arial;}
a img,:link img,:visited img { border: none; }
table { border-collapse: collapse; border-spacing: 0; }
:focus { outline: none; }
*{margin:0;padding:0;}
p, blockquote, dd, dt{margin:0 0 8px 0;line-height:1.5em;}
fieldset {padding:0px;padding-left:7px;padding-right:7px;padding-bottom:7px;}
fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
dl dd{margin:0px;}
dl dt{} .clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden;}
.clearfix{display:block;zoom:1} ul#thumblist{display:block;}
ul#thumblist li{float:left;margin-right:2px;list-style:none; text-align:center;height:80px; line-height:80px; width:100px;overflow:hidden;}
ul#thumblist li a{display:block;border:1px solid #CCC;height:78px; line-height:78px; width:98px;overflow:hidden;}
ul#thumblist li a.zoomThumbActive{
border:1px solid red;height:78px; line-height:78px; width:98px;overflow:hidden;
}
ul#thumblist li img{ height:80px;}
.jqzoom{
text-decoration:none;
float:left;
}
</style>
<script type="text/javascript">
//使用方法
$(document).ready(function() {
$('.jqzoom').jqzoom({
zoomType: 'innerzoom',
lens:true,
preloadImages: true,
alwaysOn:false }); }); </script>
</head> <body>
<div class="clearfix" id="content" style="margin-top:100px;margin-left:350px; height:500px;width:500px;" >
<div class="clearfix">
<a href="imgProd/triumph_big1.jpg" class="jqzoom" rel='gal1' title="triumph" >
<img src="imgProd/triumph_small1.jpg" title="triumph" style="border: 1px solid #666;">
</a>
</div>
<br/>
<div class="clearfix" >
<ul id="thumblist" class="clearfix" >
<li><a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small1.jpg',largeimage: './imgProd/triumph_big1.jpg'}"><img src='imgProd/thumbs/triumph_thumb1.jpg'></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small2.jpg',largeimage: './imgProd/triumph_big2.jpg'}"><img src='imgProd/thumbs/triumph_thumb2.jpg'></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/triumph_small3.jpg',largeimage: './imgProd/triumph_big3.jpg'}"><img src='imgProd/thumbs/triumph_thumb31.jpg'></a></li>
</ul>
</div>
</div>
</body></html>
相关的参数设置(附上中文翻译)
- OPTION NAME DEFAULT DESCRIPTION
- zoomType 'standard' The others admitted option values are 'reverse','drag','innerzoom'.
- zoom模式,可选参数'reverse','drag','innerzoom'
- zoomWidth 300 The popup window width showing the zoomed area.
- 弹出的div的宽
- zoomHeight 300 The popup window height showing the zoomed area.
- 弹出的div的高
- xOffset 10 The popup window x offset from the small image. (always positive to move the popup window more on the right if position is "right" or more on the left if position is "left")
- 弹出的div的x轴偏离,如果position属性设为right,则是距离右边的距离。
- yOffset 0 The popup window y offset from the small image. (always positive to move the popup window more on the top if position is "top" or more on the bottom if position is "bottom"),
- 弹出的div的x轴偏离,同上。
- position 'right' The popup window position.Admitted values:'right' ,'left' ,'top' ,'bottom'
- 弹出的div的位置在左边,在右边,可选参数:'right' ,'left' ,'top' ,'bottom'。
- preloadImages true if set to true,jqzoom will preload large images.
- 是否弹出大图,如果为true则弹出大图。
- preloadText 'Loading zoom' The text to show while preloading images.
- 当加载图片时显示的文字。
- title true Show a small title over the zoomed window it can be the anchor title and if not specified,it will get the small image title.
- 当地弹出div时在div的顶部显示一个标题,如果没有指定则取缩略图的的标题
- lens true if set to false,the small lens,over the image, won't show.
- 是否显示小图上的小div,如果设置为false则在图片上的div不显示。
- imageOpacity 0.4 Set the image opacity when the 'zoomType' option is set to 'reverse'.
- 图片遮罩层的透明度,仅当'zoomType' 的模式为'reverse'时起效。
- showEffect 'show' The effect by which showing the popup window.Options available: 'show' ,'fadein'.
- 设置大图弹出的方式,可选参数:'show' (显示),'fadein'(淡入)。
- hideEffect 'hide' The effect by which hiding the popup window.Options available: 'hide' ,'fadeout'.
- 设置大图隐藏的方式,可选参数:'hide' (隐藏),'fadeout'(淡出)。
- fadeinSpeed 'slow' Changes fade in speed,in case the showEffect option is set to 'fadein'.(options: 'fast','slow',number)
- 设置图片弹出的速度,仅当showEffect设置为fadein时有效,可选参数:'fast','slow',数字
- fadeoutSpeed '2000' Changes fade out speed,in case the hideEffect option is set to 'fadeout'.(options: 'fast','slow',number)
- 设置图片隐藏的速度,仅当showEffect设置为fadeout时有效,可选参数:'fast','slow',数字
OPTION NAME DEFAULT DESCRIPTION
zoomType 'standard' The others admitted option values are 'reverse','drag','innerzoom'.
zoom模式,可选参数'reverse','drag','innerzoom'
zoomWidth 300 The popup window width showing the zoomed area.
弹出的div的宽
zoomHeight 300 The popup window height showing the zoomed area.
弹出的div的高
xOffset 10 The popup window x offset from the small image. (always positive to move the popup window more on the right if position is "right" or more on the left if position is "left")
弹出的div的x轴偏离,如果position属性设为right,则是距离右边的距离。
yOffset 0 The popup window y offset from the small image. (always positive to move the popup window more on the top if position is "top" or more on the bottom if position is "bottom"),
弹出的div的x轴偏离,同上。
position 'right' The popup window position.Admitted values:'right' ,'left' ,'top' ,'bottom'
弹出的div的位置在左边,在右边,可选参数:'right' ,'left' ,'top' ,'bottom'。
preloadImages true if set to true,jqzoom will preload large images.
是否弹出大图,如果为true则弹出大图。
preloadText 'Loading zoom' The text to show while preloading images.
当加载图片时显示的文字。
title true Show a small title over the zoomed window it can be the anchor title and if not specified,it will get the small image title.
当地弹出div时在div的顶部显示一个标题,如果没有指定则取缩略图的的标题
lens true if set to false,the small lens,over the image, won't show.
是否显示小图上的小div,如果设置为false则在图片上的div不显示。
imageOpacity 0.4 Set the image opacity when the 'zoomType' option is set to 'reverse'.
图片遮罩层的透明度,仅当'zoomType' 的模式为'reverse'时起效。
showEffect 'show' The effect by which showing the popup window.Options available: 'show' ,'fadein'.
设置大图弹出的方式,可选参数:'show' (显示),'fadein'(淡入)。
hideEffect 'hide' The effect by which hiding the popup window.Options available: 'hide' ,'fadeout'.
设置大图隐藏的方式,可选参数:'hide' (隐藏),'fadeout'(淡出)。
fadeinSpeed 'slow' Changes fade in speed,in case the showEffect option is set to 'fadein'.(options: 'fast','slow',number)
设置图片弹出的速度,仅当showEffect设置为fadein时有效,可选参数:'fast','slow',数字
fadeoutSpeed '2000' Changes fade out speed,in case the hideEffect option is set to 'fadeout'.(options: 'fast','slow',number)
设置图片隐藏的速度,仅当showEffect设置为fadeout时有效,可选参数:'fast','slow',数字
官方网站:http://www.mind-projects.it/projects/jqzoom/
[转]jquery 鼠标放在图片上显示图片的放大镜效果jqzoom_ev-2.3的更多相关文章
- 图解android开发在界面上显示图片
图解android开发在界面上显示图片<申明:转自百度> <原文章地址:http://jingyan.baidu.com/article/49711c6153a277fa441b7c ...
- 对话框上动态控件的创建、在Picture Control控件上显示图片
1 MFC对话框之上的动态控件的创建 对话框上的控件是MFC类的一个具体对象. 当在对话框之上使用静态控件时,可以根据类向导来为每个控件添加消息.响应函数以及变量. 当需要在对话框中动态的创建某个控 ...
- iOS View自定义窍门——UIButton实现上显示图片,下显示文字
“UIButton实现上显示图片,下显示文字”这个需求相信大家在开发中都或多或少会遇见.比如自定义分享View的时候.当然,也可以封装一个item,上边imageView,下边一个label.但是既然 ...
- JQuery鼠标移到小图显示大图效果的方法
JQuery鼠标移到小图显示大图效果的方法 本文实例讲述了JQuery鼠标移到小图显示大图效果的方法.分享给大家供大家参考.具体分析如下: 这里的显示大图功能类似上一篇<JQuery实现超链接鼠 ...
- 2019-3-16-win10-uwp-鼠标移动到图片上切换图片
title author date CreateTime categories win10 uwp 鼠标移动到图片上切换图片 lindexi 2019-03-16 14:43:46 +0800 201 ...
- img只显示图片一部分 或 css设置背景图片只显示图片指定区域
17:14 2016/3/22img只显示图片一部分 或 css设置背景图片只显示图片指定区域 background-position: 100% 56%; 设置背景图片显示图片的哪个坐标区域,图片左 ...
- JS兼容各个浏览器的本地图片上传即时预览效果
JS兼容各个浏览器的本地图片上传即时预览效果 很早以前 在工作曾经碰到这么一个需求,当时也是纠结了很久,也是google了很久,没有碰到合适的demo,今天特意研究了下这方面的的问题,所以也就做了个简 ...
- CSS实现鼠标放图片上显示白色边框+文字描写叙述
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- ABAP 在屏幕上显示图片
1.se78 上传 或 预览图片 图片预览 2.程序代码 定义各变量 DATA: H_PICTURE TYPE REF TO CL_GUI_PICTURE, H_PIC_CONTAINER TYPE ...
随机推荐
- UVa 1204 Fun Game (状压DP)
题意:有一些小孩(至少两个)围成一圈,有 n 轮游戏,每一轮从某个小孩开始往左或者往右伟手帕,拿到手帕写上自己的性别(B,G),然后以后相同方向给下一个. 然后在某个小孩结束,给出 n 轮手帕上的序列 ...
- AR# 30522:LogiCORE RapidIO - How do system_reset and link_reset work?
Description How do system_reset and link_rest work? Solution lnk_linkreset_n (input): In Xilinx SRIO ...
- .NET 实体转换辅助类
/// <summary> /// 实体转换辅助类 /// </summary> public class ModelConvertHelper<T> where ...
- c++滚动数组
说来惭愧,我老早以前就学习了dp,可直到最近才知道滚动数组. 所以说,滚动数组是什么呢? 它是一种优化dp空间复杂度的思想. 在dp转移时,我们往往不需要之前推的所有的,而是只需要前一两个转移的. 我 ...
- SourceTree——MAC OSX下的Git GUI客户端
在MAC下面为Git找一款用得顺手的GUI客户端还真不容易.学习工具使用还是先器而后道的路径比较适合我,当年上手CVS SVN都是如此,先通过tortoise客户端熟练了基本操作,之后在搭建构建平台的 ...
- Sublime3插件安装
首先声明一下,小编是做后台开发出身,但是总是想捣鼓一些小的网站出来,可能是完美心作祟,感觉前端这边不能差事,所以就自己上了,一开始是用eclipse来开发的,具体原因忘了,也不知道怎么就开始用Subl ...
- P1592 互质
题意:输入两个正整数n和k,求与n互质的第k个正整数. $n≤10^6,k≤10^8$ 可以枚举出互质的数,居然发现,有循环节.... 比如10 与其互质的1 3 7 9 11 13 17 ...
- 并查集【洛谷P1197】 [JSOI2008]星球大战
P1197 [JSOI2008]星球大战 题目描述 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治着整个星系. 某一天,凭着一个偶然的机遇,一支反抗军摧毁了帝国的超级武器,并攻下了星系 ...
- [Leetcode]016. 3Sum Closest
public class Solution { public int threeSumClosest(int[] num, int target) { int result = num[0] + nu ...
- C语言关于++i,--i,i++,i--
++i 和--i 指的是先进行运算,再进行调用(运算符在前) i++和i--指的是先进行调用,再进行运算(运算符在后) 举例: int k,i=5;k=i++;//k得到5i=5;k=++i;//k得 ...