JS、Jquery技术学习 https://www.itkc8.com
点击这里查看效果
http://keleyi.com/keleyi/phtml/jqtexiao/18.htm
效果图:
js插件:
1.<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
2.<script type="text/javascript" src="http://keleyi.com/keleyi/phtml/jqtexiao/18/jquery.enlarge.js"></script>
<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://keleyi.com/keleyi/phtml/jqtexiao/18/jquery.enlarge.js"></script>
html代码:
1.<div style="width: 986px; margin: 0px auto;">
2.<div><h3>图片放大镜</h3>把光标移动到下面图片上 <a href="http://keleyi.com/a/bjad/q2ee2xyt.htm" target="_blank">原文</a></div>
3.<a href="http://keleyi.com/image/a/5nxma18i.jpg" id="demo" style="position: relative; float: left;">
4.<img src="http://keleyi.com/image/a/qsqtberv.jpg" width="240" height="180" alt="小图">
5.<img src="http://keleyi.com/image/a/5nxma18i.jpg" width="960" height="720" style="display: none;" alt="大图">
6.</a>
7.</div>
<div style="width: 986px; margin: 0px auto;">
<div><h3>图片放大镜</h3>把光标移动到下面图片上 <a href="http://keleyi.com/a/bjad/q2ee2xyt.htm" target="_blank">原文</a></div>
<a href="http://keleyi.com/image/a/5nxma18i.jpg" id="demo" style="position: relative; float: left;">
<img src="http://keleyi.com/image/a/qsqtberv.jpg" width="240" height="180" alt="小图">
<img src="http://keleyi.com/image/a/5nxma18i.jpg" width="960" height="720" style="display: none;" alt="大图">
</a>
</div>
javascript代码:
1.<script type="text/javascript">
2.//柯乐义 http://keleyi.com
3.$(function () {
4.$("#demo").enlarge(
5.{
6.// 鼠标遮罩层样式
7.shadecolor: "#FFD24D",
8.shadeborder: "#FF8000",
9.shadeopacity: 0.4,
10.cursor: "move",
11.
12.// 大图外层样式
13.layerwidth: 480,
14.layerheight: 360,
15.layerborder: "#DDD",
16.fade: true,
17.
18.// 大图尺寸
19.largewidth: 960,
20.largeheight: 720
21.});
22.});
23.
24.</script>
JS、Jquery技术学习 https://www.itkc8.com