JQuery UI Tabs Causing Screen to “Jump”

后端 未结 17 1825
生来不讨喜
生来不讨喜 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 23:13

    Try using event.preventDefault();. On the click event which is switching the tabs. My function looks like this:

        $(function() {
            var $tabs = $('#measureTabs').tabs();
            $(".btn-contiue").click(function (event) {
                event.preventDefault();
                $( "#measureTabs" ).tabs( "option", "active", $("#measureTabs").tabs   ('option', 'active')+1  );
            });
        });
    

提交回复
热议问题