MG 1.1 Gallery images and lazyload

Nuno

Well-known member
Hello

Today I was testing some threads with webpagetest.org and notice something strange with gallery lazyload.

In the html headers we have:

Code:
class="Public NoJs GalleryLazyLoader LoggedIn NoSidebar RunDeferred Responsive"

In this print screen, we can see that all images in the thread are downloaded, even though they are not in the viewport:

wpt_media.webp

Comparing with Xon's LazyLoad, this is a test with attachment images with LazyLoad on:

wpt_att_lazyload_on.webp

And this is the same page with lazyload off

wpt_att_lazyload_off.webp

We ca see the diference ... shouldn't xfmg only download images when they are in the viewport?
 
What you're expecting the system to do isn't what it does. It's a lazy load in that it requests the details via the client rather than trying to do it piecemeal server side. It's not a viewport-backed image loader.
 
Hi

Just an update ... the 301 redirect that I was seeing above, is related to this addon. I already sent a PM to the author to see if this can be changed.

Regarding Lazyload for Media, I see that the css classes that surround the photos are:

Code:
.GalleryLazyLoader .galleryBbCode .galleryImage

May I ask to @Chris D , since this is done with css, in theory there should be a way to hide (display : none) the images and only show them when we scrooll the page and they are near the viewport.

Should this work in a real world?

I already tested with jquery .css method and some javascript to detect if the image is in the viewport but I can't get it to work :(
 
Unfortunately this is somewhat beyond the scope of support, and likely not something that's simple to do without custom development.
 
Top Bottom