jQuery Fancybox Not Recognizing Element

邮差的信 提交于 2019-12-02 18:26:22

问题


<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'
    });
});

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.

I've been working on it here: http://jsfiddle.net/2k8EP/226/


回答1:


Just add type: "image" to your API options

$(document).ready(function () {
    $("#attachment3655").fancybox({
        openEffect: 'none',
        closeEffect: 'none',
        type: "image"
    });
});

Your forked jsfiddle

BTW, that is documented HERE, tab FAQ, number 5.



来源:https://stackoverflow.com/questions/14511090/jquery-fancybox-not-recognizing-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!