Thursday, 8 August 2013

How to open a Foundation Reveal modal javascript

How to open a Foundation Reveal modal javascript

I've been trying to follow the Foundation docs, but I really can't figure
out how to open a modal window using jQuery. Here's what I have:
Fiddle
HTML:
<a href="#" id="myModal" class="reveal-link">Name</a>
<div id="myModal" class="reveal-modal">
<a class="close-reveal-modal">&#215;</a>
</div>
jQuery:
$(document).ready(function(){
$(document).foundation();
$('a.reveal-link').trigger('click');
$('a.close-reveal-modal').trigger('click');
});
Thanks, any help would be appreciated!

No comments:

Post a Comment