jQuery Fancybox无法识别元素 [英] jQuery Fancybox Not Recognizing Element
本文介绍了jQuery Fancybox无法识别元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<a id="attachment3655" rel="Lightbox_109160" href="https://xenogamers.org/attachment.php?attachmentid=3655&d=1350682390">
<img class="thumbnail" border="0" style="float:CONFIG" alt="Click image for larger version. Name: 253635_10150631007825720_595485719_18819556_7955719_n.jpg Views: 32 Size: 100.9 KB ID: 3655" src="https://xenogamers.org/attachment.php?attachmentid=3655&d=1359000187&thumb=1" title="Click image for larger version. Name: 253635_10150631007825720_595485719_18819556_7955719_n.jpg Views: 32 Size: 100.9 KB ID: 3655">
</a>
$(document).ready(function () {
$("#attachment3655").fancybox({
openEffect: 'none',
closeEffect: 'none'
});
});
它根本无法识别ID,我也不知道为什么.我无法轻易更改上述源代码,因此无法找出仅使用jquery来实现此目的的方法.
It won't recognize the a id at all, and I can't figure out why. I can't change the source above easily so I cannot figure out a way to do this with only jquery.
我一直在这里进行操作: http://jsfiddle.net/2k8EP/226/
I've been working on it here: http://jsfiddle.net/2k8EP/226/
推荐答案
只需将type: "image"
添加到您的API选项中
Just add type: "image"
to your API options
$(document).ready(function () {
$("#attachment3655").fancybox({
openEffect: 'none',
closeEffect: 'none',
type: "image"
});
});
您的 分叉的jsfiddle
Your forked jsfiddle
BTW,已记录为 HERE ,常见问题解答,编号5.
BTW, that is documented HERE, tab FAQ, number 5.
这篇关于jQuery Fancybox无法识别元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文