Support auto-playDefinable mouse event delayNo restriction on html structureAssume the HTML is as follows: Copy code The code is as follows: tab1 tab2< /li> tab3 content1 content2 content3 Execute the defined tab initialization function Copy code The code is as follows: <br>var tabType={ <br> trigger:'trigger event', <br>tabCurrentClass:'className of current tab' <br>[, delay:'delay of event triggering', <br>auto:'whether to play automatically', <br>timer:' Automatic playback period'] <br>} <br>// The first two of tabType are required parameters, the next three can be added as needed <br>// The subsequent tab->content correspondence is added in the form of an array , identified by its id as a parameter, as follows: <br>// [tab1.id, content1.id,'o'], [tab2.id, content2.id],... <br>// If you want to set A certain tab is open by default, add an "o" parameter at the end, as follows: <br>//eg: tabInit(tabType,[t1,c1,'o'],[t2,c2],…); <br>} <br>tabInit(type,['t1','c1','o'],['t2','c2'],['t3','c3']); <br>< /script> <br> </div> <br>Demo address:<a href="http://demo.jb51.net/js/tab_switch/tab.html" target="_blank">http://demo.jb51.net/js/tab_switch/tab.html<br></a>Package download address:<a href="http://www.jb51.net/jiaoben/25777.html" target="_blank">http: //www.jb51.net/jiaoben/25777.html</a>