简体   繁体   English

导航箭头在fancybox中不起作用

[英]Navigation arrows not working in fancybox

I'm trying to make fancybox2 work on my website and am having problems with navigation arrows. 我正在尝试使fancybox2在我的网站上工作,并且导航箭头出现问题。

Clicking on prev/next arrow when looking at an image which is part of a gallery (same rel) just lead to an empty squared fancybox with "next" (or "previous") as a title. 在查看属于图库(相同rel)的图像时,单击prev / next箭头只会导致一个带有“ next”(或“ previous”)作为标题的空方形花式框。 I'm not able to go back to the image I was looking and must close the fancybox. 我无法返回到所查找的图像,必须关闭fancybox。

What is weird is that Fancybox seems to work correctly though, all scripts and css are correctly loaded, I'm able to open an image in a fancybox and even to navigate between items of the same gallery either with the keyboard or by clicking on content when activating the nextclick option (hence showing that my own options are correctly taken into account). 奇怪的是,尽管Fancybox似乎可以正常工作,所有脚本和CSS均已正确加载,但我可以在fancybox中打开图像,甚至可以通过键盘或单击内容在同一图库的项目之间导航激活nextclick选项时(因此表明正确考虑了我自己的选项)。

Configuration: wordpress 3.3.1, php 5.5.9, tested on updated Chrome and FF. 配置:wordpress 3.3.1,php 5.5.9,已在更新的Chrome和FF上进行了测试。

Here are some codes portion I used: 这是我使用的一些代码部分:

jQuery(document).ready(function() {

jQuery("a[class*=fancybox]").fancybox({
        nextClick:'true',
        openEffect      : 'elastic',
        closeEffect     : 'fade',
        nextEffect      : 'easeOutBack',
        prevEffect      : 'easeInBack',
        helpers : {
            title : {
                type : 'outside'
            }
        },

  });

});

And on my page, my gallery is set up with different items defined as follows: 在我的页面上,画廊中设置了不同的项目,定义如下:

<a rel="gallery" class="gallery fancybox" href="link to myimage.jpg"></a>

Thanks for any help given! 感谢您提供的任何帮助!

For starters you should use jQuery("a.fancybox") in to initiate your fancybox on and I doubt your php version is correct. 对于初学者,您应该使用jQuery("a.fancybox")来启动您的fancybox,我怀疑您的php版本是否正确。

If you're getting an empty fancybox then that could mean the object that is next/prev wasn't loaded properly. 如果您得到一个空的花式框,则可能意味着下一个/上一个对象未​​正确加载。

Also check for errors in the console (in Chrome F12) and post those. 另外,请检查控制台中的错误(在Chrome F12中),然后发布。 The information you've given us to debug is a little meager. 您提供给我们的调试信息很少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM