Lucas Ratske
Lucas Ratske

Reputation: 1

Is it possible to fire event on jquery tabs plugin when the tab loads?

I want to fire an event when the tab loads, I already tried something like this:

$("#tabInicio").tabs({
    activate: function (event, ui) {
        if (ui.newTab.length != 0 && ui.newPanel.length != 0) {
            alert("XXXXX");
        }
    }
}); 

Upvotes: 0

Views: 80

Answers (1)

adeneo
adeneo

Reputation: 318302

The documentation states that there is a load event especially for when a tab loads :

$("#tabInicio").tabs({
  load: function( event, ui ) {

  }
});

The activate event is triggered after a tab has been activated, and you should make sure you're testing the length of the right properties ?

Upvotes: 3

Related Questions