Showing posts with label scrollLeft. Show all posts
Showing posts with label scrollLeft. Show all posts

Sunday, February 5, 2012

Issue with "ScrollLeft" animation using jquery

In my recent attempt to build a site with horizontal parallax (sites with multiple moving backgrounds..eg: http://www.liptonicetea.pl/), i came across an issue where my code would only work in chrome but not in other browsers.
After searching on google i came across some articles stating same issue. I was able to resolve it by changing the selector i was using for the animation.
Earlier i was using

$(window).animate({"scrollLeft":1100},1500)


I changed it to


$("html,body").animate({"scrollLeft":1100},1500)


and now my code works perfectly fine across all the browsers.