ajaxwordpresslazy-loadingwordpress-jetpack

Reinitialize JetPack Lazy Load


I am using JetPack on my WordPress site, and have lazy loading enabled. However, in my site I update some content with AJAX, and this results in loading the 1x1 placeholder of images, rather than the true image, which the lazy load would handle.

How do I call lazy loading again, using Jet Pack? I seem to recall there being a JavaScript function, but can't find what it is.


Solution

  • This works for me.

    $(document.body).trigger('post-load');
    

    It triggers a jQuery event that the lazy load module is listening for to lazy load images from infinite scroll.