When I open group of images with fancybox "Index of start", I have a problem.
//"img[2]" it's img with rel=2
When I click on img, it's opens. After load, when I click "prev Img" - it's working normally, but on click "next img" - Gallery start playing from img[0]. using fancyBox v2.0.3. in action: http://youtu.be/1dii1qC9cOM
HTML:
<ul class="gallery">
<li>
<a rel="0" data-fancybox-group="PHOTOGALLERY"> <img alt="" src="1.jpg"> </a>
</li>
<li>
<a rel="1" data-fancybox-group="PHOTOGALLERY"> <img alt="" src="2.jpg"> </a>
</li>
<li>
<a rel="2" data-fancybox-group="PHOTOGALLERY"> <img alt="" src="3.jpg"> </a>
</li>
<li>
<a rel="3" data-fancybox-group="PHOTOGALLERY"> <img alt="" src="4.jpg"> </a>
</li>
</ul>
JS:
// Using group of images, received from ajax
var hrefList = new Array;
for (var i in data) {
hrefList[i] = data[i].PATH
}
ul.find('a').live('click',function(e){
e.preventDefault();
var himself = $(this);
$.fancybox( hrefList, {
'index': himself.attr('rel')
});
});