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.png

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

wpt_att_lazyload_on.png

And this is the same page with lazyload off

wpt_att_lazyload_off.png

We ca see the diference ... shouldn't xfmg only download images when they are in the viewport?
 

Mike

XenForo developer
Staff member
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.
 

Nuno

Well-known member
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 :(
 

Chris D

XenForo developer
Staff member
Unfortunately this is somewhat beyond the scope of support, and likely not something that's simple to do without custom development.
 
Top