How to trigger('click') on jquery tab's currently active tab

后端 未结 3 1286
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-17 16:36

I have a tabed screen and want to trigger a click on the selected tab once the form is submitted and the return is valid. Here a part of the html:

3条回答
  •  既然无缘
    2021-01-17 17:12

    If you want to reload the tab programmatically then i recommend use Jquery Tab API utility like below: This makes first tab active and then activates second tab, quite simple and also raises the events that would be normally raised when you click directly.

    $( "#myTabs" ).tabs( "option", "active", 0 );
    
    $( "#myTabss" ).tabs( "option", "active", 1 );
    

    Also you can catch tabs active event like below for performing any operations

    $( "#myTabs" ).on( "tabsactivate", function( event, ui ) {
        // your custom code on tab click
    });
    

提交回复
热议问题