coderslay
coderslay

Reputation: 14370

How to capture the event when the tabs are changed in jQuery Mobile

I have the following Tab layout JsFiddle Code.

Now i need to capture the event when i change from one tab1 to tab2 so that i can execute certain functions when tab 2 is shown.

Upvotes: 1

Views: 196

Answers (1)

Reddy Prasad
Reddy Prasad

Reputation: 251

Check the following ....
http://jsfiddle.net/reddyprasad321/gMeQH/11/ Your example was modified... In side of your " navButtonClick() "function we can find the id of tab you clicked.. then we can play with it.

            function navButtonClick(event) {
                        $navbtns.removeClass( "ui-btn-active" );
                        $( this ).addClass( "ui-btn-active" );
                    // Here we can find the id   
        alert('you clicked tab id is :'+$(this).attr('id'));
....
....
....
}

Upvotes: 2

Related Questions