导航箭头在fancybox中不起作用 [英] Navigation arrows not working in fancybox

查看:81
本文介绍了导航箭头在fancybox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使fancybox2在我的网站上正常工作,并且导航箭头出现问题.

I'm trying to make fancybox2 work on my website and am having problems with navigation arrows.

在查看属于图库(相同rel)的图像时,单击prev/next箭头只会导致出现一个带有"next"(或"previous")作为标题的空方形花式框.我无法返回到所查找的图像,必须关闭fancybox.

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. I'm not able to go back to the image I was looking and must close the fancybox.

奇怪的是,虽然Fancybox似乎可以正常工作,所有脚本和CSS均已正确加载,但我可以在fancybox中打开图像,甚至可以通过键盘或通过导航在同一图库的项目之间导航激活nextclick选项时单击内容(因此表明正确地考虑了我自己的选项).

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).

配置:wordpress 3.3.1,php 5.5.9,已在更新的Chrome和FF上进行了测试.

Configuration: wordpress 3.3.1, php 5.5.9, tested on updated Chrome and 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!

推荐答案

对于初学者,您应该使用jQuery("a.fancybox") in来启动您的fancybox,我怀疑您的php版本是否正确.

For starters you should use jQuery("a.fancybox") in to initiate your fancybox on and I doubt your php version is correct.

如果您得到一个空的花式框,则可能意味着下一个/上一个对象未​​正确加载.

If you're getting an empty fancybox then that could mean the object that is next/prev wasn't loaded properly.

还要检查控制台中的错误(在Chrome F12中),然后将其发布.您提供给我们的调试信息很少.

Also check for errors in the console (in Chrome F12) and post those. The information you've given us to debug is a little meager.

这篇关于导航箭头在fancybox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆