Menu icon Foundation
reveal not working

reveal not working with the corresponding data attribute in place,

but it's working when i call the javascript methods

$('#myModal').foundation('reveal', 'open');
$('#myModal').foundation('reveal', 'close');

            

         <a href="#" data-reveal-id="myModal">Click Me For A Modal</a>

<div id="myModal" class="reveal-modal" data-reveal>
  <h2>Awesome. I have it.</h2>
  <p class="lead">Your couch.  It is mine.</p>
  <p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
  <a class="close-reveal-modal">&#215;</a>
</div>

            

         <a href="#" data-reveal-id="myModal">Click Me For A Modal</a>

<div id="myModal" class="reveal-modal" data-reveal>
  <h2>Awesome. I have it.</h2>
  <p class="lead">Your couch.  It is mine.</p>
  <p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
  <a class="close-reveal-modal">&#215;</a>
</div>

reveal

reveal not working with the corresponding data attribute in place,

but it's working when i call the javascript methods

$('#myModal').foundation('reveal', 'open');
$('#myModal').foundation('reveal', 'close');

            

         <a href="#" data-reveal-id="myModal">Click Me For A Modal</a>

<div id="myModal" class="reveal-modal" data-reveal>
  <h2>Awesome. I have it.</h2>
  <p class="lead">Your couch.  It is mine.</p>
  <p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
  <a class="close-reveal-modal">&#215;</a>
</div>

            

         <a href="#" data-reveal-id="myModal">Click Me For A Modal</a>

<div id="myModal" class="reveal-modal" data-reveal>
  <h2>Awesome. I have it.</h2>
  <p class="lead">Your couch.  It is mine.</p>
  <p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
  <a class="close-reveal-modal">&#215;</a>
</div>
Alexander Assimidis over 4 years ago

Did you initialize foundation at the bottom of your Page or in a document ready block in your JS File?

 $(document).foundation();

Stephanie Gutierrez over 4 years ago

Jakkir,

Can you post your code on how you got the javascript functions to open your modal? I am struggling with the exact opposite problem you have.