JQuery UI Tabs Causing Screen to “Jump”

后端 未结 17 1827
生来不讨喜
生来不讨喜 2020-11-30 22:22

I\'m using the latest version of the jQuery UI tabs. I have tabs positioned toward the bottom of the page.

Every time I click a tab, the screen jumps toward the top

17条回答
  •  执念已碎
    2020-11-30 22:57

    I had the same problem with jquery ui's menu - a preventDefault() on the anchor's click event stops the page from scrolling back to the top:

     $("ul.ui-menu li a").click(function(e) {
          e.preventDefault();
     });
    

提交回复
热议问题