简体   繁体   中英

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,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM