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 e.preventdefault

  $ ("#dialog") .dialog ({autoOpen: false, show: {effect: "blind", period : 1000}, hide: {effect: "explosion", duration: 1000}}); $ ("#BTN_SC2"). Click (function () {$ ("#dialog") .dialog ("open");});   

and the button to open it:

  & 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

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -