javascript - colorbox two links at image but display once in group -
i have 2 different link same image of grouping each image bu view photo 1 time in grouping navigation
<a href="myimg1.jpg" class="img-gallery" rel="gallery"><img src="img-place-holder.jpg"></a> <a href="myimg1.jpg" class="img-gallery" rel="gallery">open image</a> <a href="myimg2.jpg" class="img-gallery" rel="gallery"><img src="img-place-holder.jpg"></a> <a href="myimg2.jpg" class="img-gallery" rel="gallery">open image</a>
with code found 4 images in gallery instead of 2
i found way solve on colorbox faq: http://www.jacklmoore.com/colorbox/faq/#faq-click not copy/paste , go, might set on right direction.
var $gallery = $("a[rel=gallery]").colorbox(); $("a#opengallery").click(function(e){ e.preventdefault(); $gallery.eq(0).click(); });
it of import remove rel
attribute on gallery button (which prevents duplication of image).
javascript colorbox
No comments:
Post a Comment