jquery - fancybox related thumbnails are not loading instead it loads all the thumbs from the gallery -
i trying create gallery load thumbnails.using fancybox able achieve loads thumbnails @ once instead of related gallery thumbnails. here code reference:
<div class="fancybox_container" data-project="<?php echo $post->id; ?>"> <?php $slider = get_field("slider"); if($slider): foreach($slider $slide): $img = $slide["slide"]["img"]; $gallery = $post->id; $title = get_the_title(); echo "<a class='fancybox-thumbs' data-fancybox-group='thumb' rel='gallery-{$gallery}' title='{$title}' href='{$img}'><img src='{$img}' /></a>"; endforeach; endif; ?> </div>
jquery:
<script type="text/javascript"> jquery(document).ready(function($){ $('.fancybox-thumbs').fancybox({ preveffect : 'none', nexteffect : 'none', closebtn : true, arrows : true, nextclick : true, helpers : { thumbs : { width : 100, height : 100 }, title : { type : 'inside' } }, afterload : function() { this.title = '<h5>image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '</h5>'); } }); }); </script>
here link gallery page. please correct if doing thing wrong.
http://adi.errortree.com/residential/
any appreciate it.
thanks in advance
after changing
echo "<a class='fancybox-thumbs' data-fancybox-group='thumb' rel='gallery-{$gallery}' title='{$title}' href='{$img}'><img src='{$img}' /></a>";
echo "<a class='fancybox-thumbs' data-fancybox-group='gallery-{$gallery}' rel='gallery-{$gallery}' title='{$title}' href='{$img}'><img src='{$img}' /></a>";
issue got fixed.
Comments
Post a Comment