Edelcom
Edelcom

Reputation: 5058

Stopping rotate when a tab is clicked when using jQuery UI Tabs

I am using the following :

$("#roottexts").tabs().tabs("rotate",5000, true);

to let the tabs display their contents in turn.

However , I would like the rotation to stop as soon as the user clicks one tab (or hovers over a tab).

Does anyone has code to do this ?

Thx in advance,

Upvotes: 0

Views: 711

Answers (1)

Loïc Février
Loïc Février

Reputation: 7750

Simply

$("#roottexts").tabs().tabs("rotate",5000, false);

From the documentation ( http://jqueryui.com/demos/tabs/ )

Set up an automatic rotation through tabs of a tab pane. The second argument is an amount of time in milliseconds until the next tab in the cycle gets activated. Use 0 or null to stop the rotation. The third controls whether or not to continue the rotation after a tab has been selected by a user. Default: false.

I might be good to first look at the documentation (and I found the JQuery UI particulary good), often your answer is right there....

Upvotes: 4

Related Questions