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

Ajax response lazyload initialization setTimeout issue #124

Open soumyarajtryz opened 4 years ago

soumyarajtryz commented 4 years ago

Image disappears after selecting sort filter in our sandbox url https://dev03-store-tmlewin.demandware.net/s/tmluk/ties/

lazyLoadXT is already initialized after checking success ajax response .

The solution is mention in github for ajax response is as follows

To apply lazy loading to new loaded content using ajaxComplete event. Note that $.lazyLoadXT.loadEvent = 'pageshow ajaxComplete'; may not work correctly because of content is not added to the page at the time of ajaxComplete event, that's why it's better to postpone initialization by setTimeout. But, this will not be a solution as the content load time (ajax response time) will vary on our different environments. Is there a more accurate solution to this issue with the settimeout event ?