I'm trying to build a parallax site, which will move few elements while scrolling the site.
But instead of using a scroll event listener I'm using requestAnimationFrame
, after reading this post by Paul Irish, and this video which said that scroll listener is a bit buggy. My questions are:
- It looks quite smooth in Chrome, but it's flickering badly in Firefox. Did I do something wrong here?
- Does my code actually taking up more resources than using normal scroll event listener? I can hear my laptop fan blazing every time I'm playing with this code.
My file is located at http://www.socialbuzz.com.au/index.html, and please scroll to the bottom of the page to see the element that's being manipulated from javascript.