鼠标滚动放大图片 支持多图异步加载
大图片是异步加载的,有些浏览器兼容性有些问题,加减号无效,不过仍然可以用鼠标滚动后放大和缩小
XML/HTML Code
- <div class="gallery">
- <script type='text/javascript'>
- jQuery(function ($) {
- $('.zoom_thumbnails').find('li a').each(function () {
- $(this).bind('click', { src: $(this).attr('href') }, function (e) {
- $('.zoom_container').smoothZoom('destroy').css('background-image', 'url(images/loading.gif)').smoothZoom({
- image_url: e.data.src,
- //width: 778,
- height: 320,
- background_COLOR: 'transparent',
- responsive: true,
- responsive_maintain_ratio: true,
- max_WIDTH: '',
- max_HEIGHT: '',
- pan_BUTTONS_SHOW: false
- });
- return false;
- });
- }).eq(0).trigger('click');
- });
- </script>
- <div class="zoom_container">
- </div>
- <div class="zoom_thumbnails">
- <ul>
- <li>
- <a href="../dandong.png">
- <img src="../dandong.png" width="150"/>
- </a>
- </li>
- <li>
- <a href="../erlianhaote.png">
- <img src="../erlianhaote.png" width="150"/>
- </a>
- </li>
- </ul>
- </div>
- </div>
原文地址:http://www.freejs.net/article_jquerytupiantexiao_448.html