【问题标题】:Fancybox will not openFancybox 打不开
【发布时间】:2015-06-20 04:51:54
【问题描述】:

我正在使用内容轮播(来自 codrops),每个项目都使用 Fancybox 打开更多信息。问题是,Fancybox 打不开。我认为可能存在 jquery 冲突,因为我正在使用 jquery.migrate 以便轮播工作。

我的 HTML 如下:

<a href="#historyslide1" class="fancybox" data-fancybox-group="historygaller"><img src="img/historyslider/1900.jpg" class="img-responsive">
<h3>1900</h3>
<p>Benjamin Bones.... </p>
<span class="historyplus">&nbsp;</span>
</a>

应该打开:

<div id="history-slide1"> class="historyslider">text text</div >

JS 是:

$(document).ready(function() {
    $('.fancybox').fancybox({

        closeBtn: false,
        openEffect: 'fade',
        closeEffect: 'fade',
        prevEffect: 'fade',
        nextEffect: 'fade',
        maxWidth: 800,
        loop: false
    });
});

网站在这里:http://smmcnyc.com/work/bnc/history.html

【问题讨论】:

  • data-fancybox-group="historygallery" 并且 id="history-slide1" 中的 div 已关闭。使用 jquery 1.10 时会打开 Fancybox
  • &lt;div id="history-slide1"&gt; class="historyslider"&gt;text text&lt;/div &gt; 是错字还是您的实际代码?如果是第二个,则存在语法错误(idclass 之间的额外关闭 &gt;
  • 另外,请注意控制台中的 js 错误。其他脚本错误可能会阻止 fancybox 工作

标签: jquery fancybox circular-content-carousel


【解决方案1】:

固定使用

<script src="https://code.jquery.com/jquery-git1.min.js"></script>   <script src="https://code.jquery.com/jquery-migrate-git.min.js"></script>

和更新fancybox版本

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-18
    • 1970-01-01
    • 2014-04-16
    • 1970-01-01
    相关资源
    最近更新 更多