Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery fancybox V3+;同位素排序_Jquery_Sorting_Jquery Isotope_Fancybox 3 - Fatal编程技术网

Jquery fancybox V3+;同位素排序

Jquery fancybox V3+;同位素排序,jquery,sorting,jquery-isotope,fancybox-3,Jquery,Sorting,Jquery Isotope,Fancybox 3,我需要你的帮助:我正在使用同位素对同样用fancybox打开的缩略图进行排序。在那之前,我使用fancybox V2,它工作得非常好!(我跟着主题) 但我刚刚切换到Fancybox V3,我无法在Fancybox中对我的图像进行排序 <div id="gallery"> <div class="item" data-date="20130731">Image B</div> <div class="item" data-date="2014032

我需要你的帮助:我正在使用同位素对同样用fancybox打开的缩略图进行排序。在那之前,我使用fancybox V2,它工作得非常好!(我跟着主题) 但我刚刚切换到Fancybox V3,我无法在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>

图像B
图像A
图D
图C
而js:

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

function sort_li(a, b){
    return ($(b).data('date')) < ($(a).data('date')) ? 1 : -1;    
}
$(“#works.item”).sort(sort#li).appendTo(“#gallery”);
函数排序(a,b){
返回($(b).数据('date'))<($(a).数据('date'))?1:-1;
}
看起来fancybox没有更新此列表。。。
你有什么想法吗?多谢各位

我刚刚看到,当我用以下代码删除fancybox选项时:(与下面相同为空)


该功能排序工作得很好

请提供完整的示例代码或更好的现场演示。
$('.fancybox').fancybox({
});