Background images in a grid
-
Hello Florian,
A few months ago you had tried to help me to make Lazy loader work with a masonry plugin “The Grid”. Unfortunately, although height and width attributes are set for images, images keep being positionned too high relative to each other and so overlap on loading (although resizing the browser makes everything fall back nicely in place, but I cannot expect visitors to do that).
So I will try to use Lazy loader with a fixed grid layout (each element has same height). Contrary to the masonry this fixed grid layout uses background images.
It seems I just have to add the class “lazyload” to the right div and tick unveilhooks. In my case something like:
<div class=”tg-item-image lazyload” style=”background-image: url(https://mysite.com/wordpress/wp-content/uploads/2017/04/image.jpg)”></div>
I tried to test it manually for one image and it seems to work (lazyload is transformed into lazyloaded).
Am I correct?
As I am not a developer, if you have a good resource showing how to easily add classes to certain divs (with php?) I would be happy to know about it. If not I will try by myself.
Thanks for your help!
Nicolas
- The topic ‘Background images in a grid’ is closed to new replies.