开发者

How to get the default loaded tab text in JQuery UI tabs plugin?

开发者 https://www.devze.com 2023-02-17 16:41 出处:网络
This is my code to get the tab\'s text when I click the tab: $(\'#tab\').tabs({ fx: { opacity:\'toggle\', duration:300 },

This is my code to get the tab's text when I click the tab:

$('#tab').tabs({
  fx: { opacity:'toggle', duration:300 },

 select: function(event, ui) {

    var text = $(ui.tab).text();
 }
});

But how can I get the default selected tab's text when 开发者_C百科it created.E.g: Three tab:

Tabs-Menu1 Tabs-Menu2 Tabs-Menu3

And the Tabs-Menus1 was default selected when the tabs was loaded.And I want to get the Tabs-Menu1 tab's text at the tabs was loaded.

Thank you very much!!


Use create to run a callback function when the tabs are created:

create: function(event, ui) {  
    var text = $(ui.tab).text();
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号