tuupola / lazyload

Vanilla JavaScript plugin for lazyloading images

Home Page:https://appelsiini.net/projects/lazyload/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.8.3 - new initial update() behavior crashes image loading

flopi opened this issue · comments

After upgrading from 1.8.2 to 1.8.3 (to address the Safai/Webkit initial loading bug),
images (using a container in my case) did not load dynamically.

To get both working (Safari and the dynamically loading) I simply copied the old function back in:

Line #147:
/* Force initial check if images should appear. */
$(window).load(function() {
update();
});
$(document).ready(function() {
update();
});

just FYI the function I use to "dynamically" assign a lazyload (as I have around 100 containers with several pictures on one page, I cannot initialize all lazyloaders at once due to performance):

$("img.lazy").show().lazyload({
effect : "fadeIn",
placeholder: "images/loading.gif",
container: $('#scroller'+scroller)
});

while the sroller variable is the id of the container that I want to load dynamically after an event fires (click, scroll).

URL of the page you have problem with?

I have the same problem.

This code work on Lazyload 1.8.2 but not on 1.8.3.

$('#take-photo-button').before(output); // 'output' contain <img> that has class "lazy"
$('img.lazy').lazyload();

Note: I tested on jQueryMobile 1.2.0 with Android 4.0.4

Should be fixed in 1.8.5. Could you test with the latest and reopen the issue if you still experience problems.