Roll (50);
The function roll (t) {
Var ul1=document. GetElementById (" comment1 ");
Var ul2=document. GetElementById (" comment2 ");
Var ulbox=document. GetElementById (" review_box ");
Ul2. InnerHTML=ul1. InnerHTML;
Ulbox. ScrollTop=0;
Var timer=setInterval (rollStart, t);
Ulbox. onm ouseover=function () {
clearInterval(timer);
}
//mouse after removed div continue rolling
Ulbox. onm ouseout=function () {
The timer=setInterval (rollStart, t);
}
}
//start rolling function
The function rollStart () {
//the above statement of the DOM object for local objects need again
Var ul1=document. GetElementById (" comment1 ");
Var ul2=document. GetElementById (" comment2 ");
Var ulbox=document. GetElementById (" review_box ");
If (ulbox scrollTop & gt; Ul1. ScrollHeight) {
Ulbox. ScrollTop=0;
} else {
Ulbox. ScrollTop++;
}
}
/* rolling over */
This is a table up circularly js, in general, no problem, also can stop the mouse moved to scroll, but sometimes, the mouse in the content, refresh a few times more, moving the mouse can't stop rolling events would happen, rolling speed is slightly slow, really don't know the specific reason
CodePudding user response:
Online, etc.,,,,CodePudding user response:
You change the onm ouseover and onm ouseout to onm ouseenter, onm ouseleave, onm ouseover and onm ouseout trigger child elementsCodePudding user response: