2014-01-31 41 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