How do I prevent scrolling to the top of a page when popping up a jQuery UI Dialog?

前端 未结 4 1680
旧时难觅i
旧时难觅i 2020-12-15 17:26

I currently use jTemplates to create a rather large table on the client, each row has a button that will open a jQuery UI dialog. However, when I scroll down the page and cl

4条回答
  •  -上瘾入骨i
    2020-12-15 17:42

    change your code like this

    $('a.closeButton').click( function(e) {
        e.preventDefault();
         $('#dialog').dialog('open');
    });
    

提交回复
热议问题