The below code works fine for only the first click event. However for any subsequent click nothing happens. I tested this on firefox, ie7 but still the same. Am I missing something?
<script type="text/javascript"> $(document).ready(function() { //$('#dialog').dialog(); $('#dialog_link').click(function() { $('#dialog').dialog(); return false; }); }); </script> </head><body> <div id="dialog" title="Dialog Title" style="display:none"> Some text</div> <p id="dialog_link">Open Dialog</p> </body></html>
try
$(document).ready(function () { //$('#dialog').dialog(); $('#dialog_link').click(function () { $('#dialog').dialog('open'); return false; }); });
there is a open arg in the last part
Try this
$(function() { $('#clickMe').click(function(event) { var mytext = $('#myText').val(); $('<div id="dialog">'+mytext+'</div>').appendTo('body'); event.preventDefault(); $("#dialog").dialog({ width: 600, modal: true, close: function(event, ui) { $("#dialog").remove(); } }); }); //close click });
And in HTML
<h3 id="clickMe">Open dialog</h3> <textarea cols="0" rows="0" id="myText" style="display:none">Some hidden text display none</textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With