-1

I'll need your help: I'm using isotope to sort thumbnails that are also open with fancybox. Until then I used fancybox V2 it worked perfectly! (I followed the subject here) But I just switched to Fancybox V3, I can not sort my images in fancybox ...

<div id="gallery">
  <div class="item" data-date="20130731">Image B</div>
  <div class="item" data-date="20140320">Image A</div>
  <div class="item" data-date="20130719">Image D</div>
  <div class="item" data-date="20120922">Image C</div>
</div>

And the js:

$("#works .item").sort(sort_li).appendTo('#gallery');

function sort_li(a, b){
    return ($(b).data('date')) < ($(a).data('date')) ? 1 : -1;    
}

Looks like fancybox does not update this list... Do you have any ideas ? Thank you very much !

1 Answers1

0

I just saw that when I delete the fancybox options with the following code: (same empty as below)

$('.fancybox').fancybox({
});

the function sorts by works very well!

cs95
  • 379,657
  • 97
  • 704
  • 746