title: Opening and closing a Reveal modal via Javascript
body: <p>I'm trying to open and close a Reveal modal via Javascript...</p>
  
  <p>I have this HTML</p>
  
  <pre><code>&lt;div class='reveal-modal' id='first-modal' data-reveal&gt;
     I'm the firstborn!
     &lt;a class='open-second'&gt;Click me!&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class='reveal-modal' id='second-modal' data-reveal&gt;
     I'm the secondborn!
     &lt;a class='close'&gt;Close modal&lt;/a&gt;
  &lt;/div&gt;
  &lt;a class='open-first'&gt;Click me!&lt;/a&gt;
  </code></pre>
  
  <p>And the following Javascript...</p>
  
  <pre><code>// 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');
  });
  </code></pre>
  
  <p>However, I see the following error...</p>
  
  <pre><code>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.&lt;anonymous&gt; (app.js:14672)
      at HTMLAnchorElement.dispatch (app.js:5026)
      at HTMLAnchorElement.elemData.handle (app.js:4831)
  </code></pre>
  
  <p>Can anyone out there tell me why this isn't working?</p>
  
  <p>Thanks!</p>