通过Javascript打开和关闭显示模式

通过Javascript打开和关闭显示模式,javascript,zurb-foundation,Javascript,Zurb Foundation,我正试图通过Javascript打开和关闭一个显示模式 // There's no need to close a previous modal before you // open another one. $('a.open-first').on('click', function() { $('#first-modal').foundation('reveal','open'); }); $('a.open-second').on('click', function() { $('

我正试图通过Javascript打开和关闭一个显示模式

// There's no need to close a previous modal before you
// open another one.
$('a.open-first').on('click', function() {
  $('#first-modal').foundation('reveal','open');
});
$('a.open-second').on('click', function() {
  $('#second-modal').foundation('reveal', 'open');
});
$('a.close').on('click', function() {
  $('#second-modal').foundation('reveal', 'close');
});
我有这个HTML

<div class='reveal-modal' id='first-modal' data-reveal>
   I'm the firstborn!
   <a class='open-second'>Click me!</a>
</div>
<div class='reveal-modal' id='second-modal' data-reveal>
   I'm the secondborn!
   <a class='close'>Close modal</a>
</div>
<a class='open-first'>Click me!</a>
但是,我看到以下错误

app.js:16078 Uncaught ReferenceError: We're sorry, 'reveal' is not an available method for Reveal.
    at jQuery.fn.init.foundation (app.js:16078)
    at HTMLAnchorElement.<anonymous> (app.js:14672)
    at HTMLAnchorElement.dispatch (app.js:5026)
    at HTMLAnchorElement.elemData.handle (app.js:4831)
app.js:16078未捕获引用错误:很抱歉,“揭示”不是揭示的可用方法。
在JQueR.FN.IIT.FAST(APP.JS:16078)
在兰开夏。(附录js:14672)
在htmlanchorement.dispatch(app.js:5026)
位于htmlanchorement.elemData.handle(app.js:4831)
有人能告诉我为什么这不起作用吗


谢谢

我设法找到了答案

这只是一个删除“揭示”的问题,因此

$('a.open-first').on('click', function() {
  $('#first-modal').foundation('open');
});
$('a.open-second').on('click', function() {
  $('#second-modal').foundation('open');
});
$('a.close').on('click', function() {
  $('#second-modal').foundation('close');
});

我设法找到了答案

这只是一个删除“揭示”的问题,因此

$('a.open-first').on('click', function() {
  $('#first-modal').foundation('open');
});
$('a.open-second').on('click', function() {
  $('#second-modal').foundation('open');
});
$('a.close').on('click', function() {
  $('#second-modal').foundation('close');
});

这回答了你的问题吗?这回答了你的问题吗?