jquery鼠标经过放大图片,包覆盖原图后显示大图和附近位置显示大图
XML/HTML Code
- <section id="example">
- <h2> 覆盖原图 </h2>
- <div class="easyzoom easyzoom--overlay"> <a href="example-images/1_zoom.jpg"> <img src="example-images/1_standard.jpg" alt="" width="640" height="360" /> </a> </div>
- <h2> 临近位置显示放大图片 </h2>
- <div style="float: right; width: 310px; height: 400px; background: #EEE;"></div>
- <div class="easyzoom easyzoom--adjacent"> <a href="example-images/2_zoom.jpg"> <img src="example-images/2_standard.jpg" alt="" width="310" height="400" /> </a> </div>
- </section>
JavaScript Code
- <script>
- // Instantiate EasyZoom plugin
- var $easyzoom = $('.easyzoom').easyZoom();
- // Get the instance API
- var api = $easyzoom.data('easyZoom');
- </script>
原文地址:http://www.freejs.net/article_jquerytupiantexiao_204.html