javascript - Lag/Jank When Scrolling with Parallax -
having jank/lag when scrolling in chrome on parallax site located @ http://mattsandifer.com
the parallax code taken from: http://www.minimit.com/demos/parallax-backgrounds-with-centered-content
it going smoothly , of sudden started become choppy when scrolling.
the images on larger side nothing crazy. i'm thinking it's js issue i'm not sure. tried disabling retina image there no change.
any way reduce load time or lag?
appreciate this!
edit: found link blog post saying hardware acceleration key. provided code:
window.onscroll = function(e) { // note: browsers presently use prefixes: webkittransform, moztransform etc. var parallax = document.getelementbyid('parallax-background'); parallax.style.transform = 'translate3d(0px,' + (window.scrolly/2) + 'px, 0px)'; }
not sure element plug in there code though.
Comments
Post a Comment