Lazy Images Without Jetpack

Mauer Themes Support Stills Lazy Images Without Jetpack

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3788
    Nico
    Participant

    The Stills theme supports lazy-loading of images, which is great. However this requires the Jetpack WordPress plugin to be installed, which may not be desired in some cases (WordPress.com account is required and the site needs to be connected to Automattic, etc.).

    I extracted the lazy-images module from Jetpack to provide its features (using the same implementation) without needing to install Jetpack.

    Lazy Images Without Jetpack

    #3889
    Paul
    Keymaster

    Nico,
    Thanks for having shared this.

    I hope that the browser support for loading="lazy" attribute improves soon and the task of implementing lazy images gets much easier.

    Regards,
    Paul

    #4242
    Nico
    Participant

    Paul,
    I just saw that the current “Lazy Images Without Jetpack” implementation seems to have problems with WordPress 5.6, sometimes images are not loaded at all when navigating between pages.

    As Chromium browsers already support loading=lazy, I guess it would be acceptable to disable these hacks completely – but PhotoSwipe does not seem to add loading=lazy to the img tags. Any chance this will be added, or is this not as easy because the dimensions are not clear upon rendering?

    #4355
    Paul
    Keymaster

    Nico,

    I have been testing this for some time and I believe this is dealt with Jetpack. I have experienced issues with Jetpack 9.5 under WP 5.7 where the images would not load in Firefox. I believe the problem is dealt with Jetpack not dispatching the event on lazy images load. I have installed Jetpack 9.3 and the issue is gone. Having an up-to-date version of the theme also helps as WP 5.6 has swapped jQuery 1 for jQuery 3 and older version of the theme may have issues with jQuery 3.

    The theme demo is currently running:
    WP 5.7, Jetpack 9.3, Stills 1.4.5 with no issues as far as I can see.

    Regards,
    Paul

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.