javascript - Jquery-UI diagloge scrolls to top of the page -
I am using jquery-ui and I'm trying to do this when "click me". However, since this link is directed to "#", it also scrolls at the top of the page, how can I do it? I think that this is and the button to open it: : e.preventdefault
$ ("#dialog") .dialog ({autoOpen: false, show: {effect: "blind", period : 1000}, hide: {effect: "explosion", duration: 1000}}); $ ("#BTN_SC2"). Click (function () {$ ("#dialog") .dialog ("open");});
& lt; A href = "#" class = "btn" id = "btn_sec2" & gt; Click me! & Lt; / A & gt; Try to use
$ ("# btn_sec2"). Click (function (e) {e.preventDefault (); $ ("#dialog") .dialog ("open");});
Comments
Post a Comment