Foundation 6 Reveal Modal Tiny 不工作
Foundation 6 Reveal Modal Tiny Not Working
下面是 html 的示例代码:
<div class="reveal tiny" id="testingOnly" data-reveal>
<p>testing reveal</p>
<button class="button" data-close>Close</button>
</div>
<button class="button" onclick="testingOnly.open();">Content Here</button>
对于 javascript:
var testingOnly = new Foundation.Reveal($('#testingOnly'));
我的问题是,为什么 reveal modal 总是显示得那么大? class tiny
无效,但 full
有效。我不知道为什么它不起作用。这是我的 fiddle.
那是因为你没有在你的初始化foundation页面上初始化Foundation类
$(document).foundation();
如果您从他们的官方网站下载整个包,您将得到 app.js 其中只有这一行。
下面是 html 的示例代码:
<div class="reveal tiny" id="testingOnly" data-reveal>
<p>testing reveal</p>
<button class="button" data-close>Close</button>
</div>
<button class="button" onclick="testingOnly.open();">Content Here</button>
对于 javascript:
var testingOnly = new Foundation.Reveal($('#testingOnly'));
我的问题是,为什么 reveal modal 总是显示得那么大? class tiny
无效,但 full
有效。我不知道为什么它不起作用。这是我的 fiddle.
那是因为你没有在你的初始化foundation页面上初始化Foundation类
$(document).foundation();
如果您从他们的官方网站下载整个包,您将得到 app.js 其中只有这一行。