ressio / lazy-load-xt

Lazy load XT is a jQuery plugin for images, videos and other media
http://ress.io/lazy-load-xt-jquery/
MIT License
1.36k stars 245 forks source link

Widget doesn't work if the scroll is too fast! #5

Closed nachitox closed 10 years ago

nachitox commented 10 years ago

If you scroll really fast (moving the bar with the mouse) or the URL has an anchor which is farther the data-lazy-widget, the widget doesn't load.

I think it has to do with this line: visible = (topEdge <= viewportTop && elPos.bottom > -edgeY && elPos.left <= viewportWidth + edgeX && elPos.right > -edgeX); elPos.bottom is always smaller than -edgeY.

Is there a way to overpass that ?

dryabov commented 10 years ago

If you have elPos.bottom < -edgeY, it means that element is somewhere above visible area, that's why it is not loaded. Try to set min-height for the element. And could you create a test page (e.g. on jsfiddle.net)?