2014-01-31 38 views
-1

美好的一天。延長Jquery UI選項卡事件

我想要在頁面上的所有標籤中應用此類事件,我該如何做?

activate: function (event, ui) { 
     var $t = ui.newPanel.find('table'); 
     // make sure there is a table in the tab 
     if ($t.length) { 
      if ($t[0].config) { 
       // update zebra widget 
       $t.trigger('applyWidgets'); 
      } else { 
       // initialize tablesorter 
       $t.tablesorter({ 
        theme: 'black', 
        widgets: ["zebra"] 
       }); 
      } 
     } 
    } 

回答

1

可能通過讓事件冒泡並捕獲它。

$(document).on('tabsactivate',function(event,ui){ 
// your stuff here 
}); 
+0

thx很多m8,像一個魅力工作) – user988037

+0

YW。請將答案標記爲已接受,以便人們知道您已解決問題。 :) – Scimonster