我正在为我正在开发的网站使用多个 jQuery fancyBox 实例。它位于以下的测试网址; http://youwontbelievewhathappened.com/Test/test.html
我已经使用这种类型的标记和调用在网站中设置了大部分花哨的框:
第一次加价:
<a href="#blogpostBox" title="Blog Post">Blog Post</a>
<br /><br />
<a href="#announcementBox" title="Announcement Box">Site Announcement</a>
内容调用:
<div class="fancybox">
<div id="blogpostBox" style="width:400px;height:100px;overflow:auto;">
[This is the blog post]
</div>
</div>
<div class="fancybox">
<div id="announcementBox" style="width:400px;height:100px;overflow:auto;">
[This is the announcement]
</div>
</div>
但是对于最后两个链接,我试图触发花式框;这不会触发它。它只是在站点 URL 的末尾加载“#contentdiv
”。它不可能是我将它移到外面并尝试过的位置,但仍然没有这样的运气。有什么建议吗?
这两个麻烦的链接位于可扩展的右侧栏中,标记为“单击我”
最佳答案
看起来您实际上从未在这些链接上调用 fancybox。
在您的 scripts.js 文件中,您使用这些选择器调用 fancybox:
//// Fancybox links
$("#footer a,#friendsbox a,#moreinfo").fancybox();
$("#openTextEntry").fancybox({onClosed:update_textEntry});
但这些链接在 #rightsidebar
中,因此只需将其添加到选择器中即可:
//// Fancybox links
$("#footer a,#friendsbox a,#moreinfo, #rightsidebar a").fancybox();
$("#openTextEntry").fancybox({onClosed:update_textEntry});
关于jquery - FancyBox 未触发 -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7880585/