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.52k stars 3.49k forks source link

Skrollr lazyload.js #429

Open ceehaupt opened 10 years ago

ceehaupt commented 10 years ago

Hi, I'm using skrollr with lazyload.js and on mobile, the images are not loaded when I scroll down. I think it's because of the #skrollr-body. Is there any way to get it working? Also the #skroll-body isn't calculating the height correctly on the first page load, even if lazy load is deactivated.

Thank you.

Prinzhorn commented 10 years ago

There are multiple projects named "lazyload"

ceehaupt commented 10 years ago

Lazy Load : http://www.opensource.org/licenses/mit-license.html and http://luis-almeida.github.com/unveil I'm using the wordpress plugin crazy lazy.

Prinzhorn commented 10 years ago

Lazy Load : http://www.opensource.org/licenses/mit-license.html

Copy pasta mistake I guess.

Anyway, I guess these are the issue

  1. Lazyload uses code like body.scrollTop, but it needs to use skrollrInstance.getScrollTop() to get the correct offset on mobile.
  2. If skrollr-body doesn't have the correct height, you're probably calling init too early. Wait before the images have been loaded or use the refresh method
jackblackCH commented 10 years ago

If you adapt unveil.js with your suggestion it works but the images are loaded too early at least not at correc time. any idea why? wrong calculation of the height maybe?

Prinzhorn commented 10 years ago

any idea why?

Not from the top of my head. I don't know the unveil.js source code and I also haven't seen your modifications.