Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.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
Javascript Fancybox无法按预期工作_Javascript_Jquery_Fancybox - Fatal编程技术网

Javascript Fancybox无法按预期工作

Javascript Fancybox无法按预期工作,javascript,jquery,fancybox,Javascript,Jquery,Fancybox,如果我没有单击“上一个”或“下一个”按钮,Fancybox可以正常工作,但是当我单击“上一个”或“下一个”按钮时,组图像不会加载,只有我可以单击的图像才会加载 我使用jquery.fancybox-1.3.4.js,这是我调用的脚本 $(document).ready(function() { $("a[rel=example_group]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none',

如果我没有单击“上一个”或“下一个”按钮,Fancybox可以正常工作,但是当我单击“上一个”或“下一个”按钮时,组图像不会加载,只有我可以单击的图像才会加载

我使用jquery.fancybox-1.3.4.js,这是我调用的脚本

$(document).ready(function() {
  $("a[rel=example_group]").fancybox({
    'transitionIn'  : 'none',
    'transitionOut' : 'none',
    'titlePosition' : 'over',
    'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) {
      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
  });
});
$(文档).ready(函数(){
$(“a[rel=example\u group]”)。fancybox({
“transitionIn”:“无”,
“transitionOut”:“无”,
“标题位置”:“结束”,
“标题格式”:函数(标题、currentArray、currentIndex、currentOpts){
返回'Image'+(currentIndex+1)+'/'+currentArray.length+(title.length?''+title:'')+'';
}
});
});
我称之为代码:

<a rel="example_group" href="images/page1-img3.jpg" alt="" /><img alt="" src="images/page1-img3.jpg"/></a>

给定您的示例,我只看到Fancybox在您的
a[rel=example\u group]
查询中可以找到的一个图像。你的例子完整吗

如果您看到的示例包括3个锚定标记,组中每幅图片一个锚定标记:

<a rel="example_group" title="Custom title" href="http://farm3.static.flickr.com/2641/4163443812_df0b200930.jpg">
    <img alt="" src="http://farm3.static.flickr.com/2641/4163443812_df0b200930_m.jpg" />
</a>

<a rel="example_group" title="" href="http://farm3.static.flickr.com/2591/4135665747_3091966c91.jpg">
    <img alt="" src="http://farm3.static.flickr.com/2591/4135665747_3091966c91_m.jpg" />
</a>

<a rel="example_group" title="" href="http://farm3.static.flickr.com/2561/4048285842_90b7e9f8d1.jpg">
    <img alt="" src="http://farm3.static.flickr.com/2561/4048285842_90b7e9f8d1_m.jpg" />
</a>


创建一个jsfiddle.net。jQuery的哪个版本?Fancybox已经2岁了,试着我用它,就像你给我举个例子一样。但我的问题是,当我单击“上一个”或“下一个”时,不会加载组图像,只加载我可以单击的图像,我使用jquery.fancybox-1.3.4.js