Lazy loading images not visible
-
I was debugging a friend’s site and found that lazy-loaded images were not visible on the page. With the web inspector, I saw they had opacity: 0 in the theme stylesheet.
Inspecting frontend.js, I noticed this function:
75 /* Animate images with [loading=”lazy”] attribute */
76 function cryoutAnimateLazyImages() {
77 jQuery( “#content img[loading=’lazy’]” ).on(‘load’, function(){
78 jQuery(this).addClass(‘animate-lazy’);
79 });
80 }I added some debug logging and the load event was not firing. Installing the jQuery migrate helper seems to have fixed this. Do you need to change some things for WP 5.6?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Lazy loading images not visible’ is closed to new replies.