moved scroll checks from requestAnimFrame to onscroll, improves performance