Do something after tab is visible in jquery
I'm trying to load a function in javascript (i'm using jquery) after that my tab is it showed. So this it he code that i'm testing:
$("#tabsL").html(data).tabs("destroy").tabs({
select:function(event, ui){
var section = $(ui.tab).attr("href");
var foo = section.split("-");
var looking_for = "#slideshow-carousel-"+foo[1]+"-"+foo[2]+" ul li img";
var imgangefd = $(looking_for)[0];
$(imgangefd).click();
}
});
but imgangefd need to be visible to get a click. So my question is what can i do something after the tab开发者_如何学Go is clicked and loaded and visible?
Thanks for any clue! Roberto
Bind the tabsshow
event:
$( "#tabControl" ).bind( "tabsshow", function(event, ui) {
//...
});
To check for a specific tab, look at what panel was opened (each tab opens a panel):
var panel = $(ui.panel);
精彩评论