My intention with my script is that the modal dialog should only show up after you click a link. Unfortunately, it keeps popping up immediately upon page load. I've included a jsFiddle, and the relevant snippets. What am I doing wrong?
http://jsfiddle.net/rajkumart08/y88WX/25/
jQuery:
$(document).ready(function(){ $(function() { $('#event-modal').modal({ backdrop: true }); }); }); HTML:
<div id="event-modal" class="modal hide fade"> <div class="modal-header"> <a class="close" href="#">x</a> <h3>Modal Heading</h3> </div> <div class="modal-body"> <p>Some information</p> </div> <div class="modal-footer"> <a class="btn primary" href="#">Primary</a> <a class="btn secondary" href="#">Secondary</a> </div> </div> <a href="/events/2-fefewfewfe/rsvps" data-backdrop="true" data-controls-modal="event-modal" data-keyboard="true">click to open model<span class="ico join"></span></a>
DOMready.Put that code inside aonclickhandler.It will work as you expected.By the way you have seperateHTML,JSandCSSin jsfiddle.You have mixed up everything in the above link.