【问题标题】:Foundation 6 Nested Reveal doesn't respect multipleOpenedFoundation 6嵌套显示不尊重multipleOpened
【发布时间】:2016-06-14 21:37:24
【问题描述】:

我正在使用 Foundation 6 和 Angular2,并且我有几个 Reveal 模态,需要按顺序打开。我直接从 Zurb 复制了示例,但是当我单击第一个模式中的按钮时,新模式打开并且第一个没有关闭。

multipleOpened 的默认值应该是 false,但它们只是在彼此之上打开。

Screenshot

我尝试设置data-multiple-opened="false"data-options="multipleOpened:false;",但它们仍然相互重叠。

这是我的代码:

<p><a data-open="exampleModal2">Click me for a modal</a></p>

<!-- This is the first modal -->
<div class="reveal" id="exampleModal2" data-reveal data-options="multipleOpened:false;">
  <h1>Awesome!</h1>
  <p class="lead">I have another modal inside of me!</p>
  <a class="button" data-open="exampleModal3">Click me for another modal!</a>
  <button class="close-button" data-close aria-label="Close reveal" type="button">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- This is the nested modal -->
<div class="reveal" id="exampleModal3" data-reveal data-options="multipleOpened:false;">
  <h2>ANOTHER MODAL!!!</h2>
  <button class="close-button" data-close aria-label="Close reveal" type="button">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

谁能指出我正确的方向?

【问题讨论】:

    标签: zurb-foundation zurb-reveal


    【解决方案1】:

    我不确定这是否是您想要的效果,但您可以通过将data-close 添加到启动第二个模式的按钮来强制关闭第一个模式:

    <a class="button" data-close data-open="exampleModal3">Click me for another modal!</a>
    

    JSFiddle example

    【讨论】:

    • 这正是我所需要的。很简单,非常感谢。
    猜你喜欢
    • 1970-01-01
    • 2021-12-22
    • 2015-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-09
    • 2016-07-19
    相关资源
    最近更新 更多