Is there any initialize event in Jquery UI Tabs , which executes only once when particular tab loads ?
As show function in Jquery UI tabs executes every time when tab gets load , i want an event that executes only once..
Is there any initialize event in Jquery UI Tabs , which executes only once when particular tab loads ?
As show function in Jquery UI tabs executes every time when tab gets load , i want an event that executes only once..
So set some global variable to true and next time the event fires ignore it.
var already_loaded = false;
$('#example').tabs({
load: function() {
if(already_loaded) {
return
}
already_loaded = true;
//stuff happens here
}
});
A cleaner way would be not to use a "global" variable but to use data()
to set properties.