function func() {
document.body.scrollTop++;
}
window.onmouseover = function() {
clearInterval(interval);
};
window.onmouseout = function() {
interval = setInterval(func);
};
var interval = setInterval(func);
Do you think that there are any better ways of doing this code?
Better:
- More options
- Less code