views:

14

answers:

1

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,

+1  A: 

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....

Loïc Février
@loIc Février: You are correct and I normally do read the help and manuals. This time I relied on the book `jQuery UI 1.6 - The User Interface` from Dan Wellman. I really missed this option - thanks for pointing it out. I already has asked this question in the jQuery UI forum but received no answer there.
Edelcom
I've learned jQuery UI from the documentation and examples there. Very great doc, easy to make basic example works and all the options are (mostly) well explained. The only bad point would be that the return value for callback functions is not always detailed. A `console.log` generally help me ;)
Loïc Février