I have a javascript function on the onscoll event to change a div’s style.
The problem is that most browsers draw the div after a scoll but before the onscoll event fires, so you end up with 1 or 2 frames where the div has the old style but the viewport is at the new scroll position. This can cause ugly flickering.
How do you prevent this?
Maybe set the body to overflow:hidden to start, and change it to overflow:auto once the first onscroll fires.