Stopping rotate when a tab is clicked when using jQuery UI Tabs
I am using the 开发者_StackOverflow社区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,
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....
精彩评论