Prinzhorn / skrollr

Stand-alone parallax scrolling library for mobile (Android + iOS) and desktop. No jQuery. Just plain JavaScript (and some love).
http://prinzhorn.github.io/skrollr/
MIT License
18.53k stars 3.51k forks source link

Skrollr intermittently breaking... #842

Open manueltomasir opened 7 years ago

manueltomasir commented 7 years ago

I am experiencing an issue with skrollr where sometimes it doesn't work on the initial load of a page, but once you scroll down to the element in question, and refresh the page, it works fine...

Is this something you've seen before?

For reference...

swankmedia.ca/coleman-smith

Each section has a black box with a description, there's a vertical grey line on each box that should be animating...

ronidavelman commented 7 years ago

@manueltomasir Where you able to figure this out?

manueltomasir commented 7 years ago

No, still no solution...

ronidavelman commented 7 years ago

After the skrollr.init(), try running .refresh() on your skrollr object. I had a similar issue where the last slide would break, so I had to call .refresh() once the user got 50% down the page.

manueltomasir commented 7 years ago

Thanks i'll give that a try

jrue commented 7 years ago

If you're using jQuery, this seems to work for me.

var s = skrollr.init();

$(window).on("load", function(){
   s.refresh();
});