Home > front end >  Js automatically switches
Js automatically switches

Time:10-04

How can I make this label switch, use js code, automatic switching between regularly, timer switch

CodePudding user response:

Behind your js code with the following code
 
var index=0;
SetInterval (function () {
The index (index + 1)=% tabs. The length;
Tabs [index] onm ouseover ();
}, 5000);

CodePudding user response:

 
SetInterval (function () {
Let the current=$(" TAB - the head. The current ");
Let next=null;
If (current& & Current. Next (). Length!=0) {
Next=current. The next ();
} else {
Next=$(" TAB - the head. The TAB - head - div: first ");
}
Next. AddClass (" current "). The siblings (). RemoveClass (" current ");
Let tabBody=$(" TAB - body div "). The eq (next. The index ());
TabBody. AddClass (" current "). The siblings (). RemoveClass (" current ");
}, 3000);

CodePudding user response:

reference 1/f, the sky wave response:
behind your js code with the following code
 
var index=0;
SetInterval (function () {
The index (index + 1)=% tabs. The length;
Tabs [index] onm ouseover ();
}, 5000);

No, is to let him recommend the default display is ok
  • Related