【发布时间】:2015-09-27 02:14:57
【问题描述】:
信息
我有一个div的网格。每个 div 打开一个模式。每个模态都有一个简单的缩略图库(点击缩略图,主图被替换)。
问题
缩放仅适用于原始主图像。单击缩略图后它没有意识到有一个新的主图像,因此它继续缩放原始图像。
FIDDLE
http://jsfiddle.net/zuhloobie/bcuh489d/2/
问题
如何更改代码以缩放从缩略图中选择的新主图像?
HTML<div class="container">
<div class="image wow rotateIn" data-wow-delay=".3s" data-wow-duration=".3s">
<div id="gallery" class="zoom">
<div class="content">
<img src="http://dummyimage.com/900x900/000/fff" class="image_1">
<img src="http://dummyimage.com/900x900/f00/fff" class="image_2" style="display:none">
</div>
</div>
</div>
<div class="body wow fadeInDown" data-wow-delay=".5s" data-wow-duration=".3s">
<div class="thumbnail">
<div class="thumb view2">
<a href="#" rel="2">
<img src="http://dummyimage.com/900x900/f00/fff" id="thumb_2" class="fit">
</a>
</div>
<div class="thumb view2">
<a href="#" rel="1">
<img src="http://dummyimage.com/900x900/000/fff" id="thumb_1" class="fit">
</a>
</div>
</div>
</div>
</div>
</div>
JQUERY$('#gallery').simplegallery({
galltime : 400, // transition delay
gallcontent: '.content',
gallthumbnail: '.thumbnail',
gallthumb: '.thumb'
});
$('.zoom').zoom({ on:'grab' });
使用的插件
[1]http://www.jacklmoore.com/zoom/
[2]http://www.jqueryscript.net/gallery/Minimalist-jQuery-Image-Gallery-with-Thumbnails.html
提前致谢!
【问题讨论】:
标签: jquery html thumbnails photo-gallery zooming