Home > front end >  Within the js in the if I determine to refresh the page after to be effective, but will use timer re
Within the js in the if I determine to refresh the page after to be effective, but will use timer re

Time:09-21

The function newwin ()
{
Var windowwidth=window. OuterWidth | | document. The documentElement. ClientWidth | | document. Body. ClientWidth;
If (windowwidth <679)
{
The function of $(id)
{
Return the document. The getElementById (id);
}
Var timer=setInterval (function () {repeat ()}, 1500);
Var n=1;
The function startChange ()
{
The timer=window. The setInterval (repeat, 1500);
}
The function repeat ()
{
Change (n++ % 7, false);
}
The function stopChange (x)
{
If (x <7)
{
N=x + 1;
}
Window. ClearInterval (timer);
}
The function change (x, isHandle)
{
If (isHandle) {
StopChange (x);
}
Var buttons=$(" buttons ".) getElementsByTagName (" div ");
Var divv=$(" divv "). The getElementsByTagName (" section ");
For (var I=0; I {
[I] buttons className="style1";
Divv [I] the className="closediv";
}
[x] buttons className="style2";
Divv [x]. The className="showdiv";
}
}
}


Var timer1=null;
Window. The onresize=function ()
{
Timer1 && clearTimeout (timer1);
SetTimeout (function ()
{
Newwin ();
}, 200);
}
Newwin ();
  • Related