【问题标题】:Switching from facebox to SASS bootstrap modal从 facebox 切换到 SASS 引导模式
【发布时间】:2012-01-16 00:02:02
【问题描述】:

我想为我的新项目从 facebox 切换到 bootstrap 模态的 SASS 版本。

使用 facebox,我只需在我的 link_to(...) 中添加 :rel => "facebox"

      <%= link_to "My Action",
             { :controller => :my_controller,
               :action => :my_action },
             { :rel => "facebox", :class=>"button"} %>

这会将来自:my_action 视图的HTML 加载到模态框中!简单!

现在我该如何使用 bootstrap-sass 模态来做到这一点?

【问题讨论】:

    标签: javascript jquery ruby-on-rails modal-dialog twitter-bootstrap


    【解决方案1】:

    只是一个问题:您是否尝试在该模式中显示外部(iframe 或 AJAX 加载页面)?

    在这种情况下,恐怕引导模式支持这一点。正如我在文档和source 中看到的那样,您只能在页面中显示另一个元素(由其 id 引用)。

    【讨论】:

      【解决方案2】:

      我创建了一个 shim 以允许替换旧的“facebox”,因此它可以与 Bootstrap 模态完美配合:

      https://github.com/mdchaney/facebox-bootstrap

      【讨论】:

        猜你喜欢
        • 2023-04-01
        • 1970-01-01
        • 2013-02-20
        • 1970-01-01
        • 2014-09-18
        • 1970-01-01
        • 2013-10-04
        • 2015-08-03
        • 2021-10-21
        相关资源
        最近更新 更多