【问题标题】:Can the Zurb plugin “twentytwenty” be run in a Foundation 4 Reveal Modal?Zurb 插件“twentytwenty”可以在 Foundation 4 Reveal Modal 中运行吗?
【发布时间】:2013-08-31 01:04:12
【问题描述】:

是否可以在 Foundation Reveal Modal 中运行 Zurb TwentyTwenty(滑块视图之前和之后)插件内部?我可以触发模式并显示标题,但不显示插件。该插件确实在标准列中的页面上工作,我什至尝试将其注释掉以查看是否是它。这是我为模态设置的代码:

<!-- Modal Box -->
<div id="myModal2" class="reveal-modal">
    <h3><font color="red">See the difference we can make</h3></font></hr>
    <div class="twentytwenty-container">
      <img src="img/rjh_before.jpg" />
      <img src="img/rjh_after.jpg" />
    </div>
    <a class="close-reveal-modal">&#215;</a>
</div>
<!-- Modal Box end -->

这里是触发链接:

<a href="#" data-reveal-id="myModal2">Modal Version of the 20/20 slider</a>

这是我在 Foundation 上完成的第一个项目,虽然我学得很快,但这个项目让我很难过。任何帮助将不胜感激!

【问题讨论】:

    标签: javascript jquery css modal-dialog zurb-foundation


    【解决方案1】:

    我自己找到了答案;这是 Reveal 中的一个错误。在 GitHub 上找到:

    Squashed picture when using Orbit in a Reveal - Issue #2809

    在脚本之前添加此代码用于显示:

    var resize_window = function(e) {
    $(window).trigger('resize');
    }
    
    $(document).foundation('reveal', {'opened' : resize_window});
    <!-- Not used in my case, but additionally for running Orbit -->
    $(document).foundation('orbit')
    

    工作愉快!

    【讨论】:

    • 我在使用其他滑块以及使用谷歌地图时遇到了同样的问题。当我使用 $(document).foundation('reveal', {'opened' : resize_window});您认为它也应该与其他滑块一起使用吗?非常感谢!
    猜你喜欢
    • 2013-08-30
    • 1970-01-01
    • 2014-12-15
    • 2014-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多