soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Lazyload in background images on Oxygen Builder #1583

Open Bebuk85 opened 4 years ago

Bebuk85 commented 4 years ago

Hello i am looking for lazyload on background images on Oxygen Builder with Autoptimize, but Frank of Autoptimize support told me this:

depends; if Oxygen allows background images to be set in style-attributes of the node (div) that is supposed to have the background element instead of in (so as “inline CSS”), then that can be lazyloaded by AO. Maybe check with the Oxygen people if you can have Oxygen do that?

but i do not know if Oxygen does that, thanks in advance.

https://wordpress.org/support/topic/oxygen-builder-integration-and-lazyload-on-background-images/

Kalakus commented 3 years ago

+1

Actually is possible to add inline css background image with Attributes: [New Attribute] -> Style:

background-image: url(https://www.yourwebsite.test/imagepath/imagename.jpg); background-size: cover; background-attachment: fixed; background-position: center;

And it will get lazy-loaded and webp converted, but is not easy to change it, and is not possible to change the image dinamically.

This is really a needed option, please VOTE FOR IT.

Possible solution: Add a checkbox on the background section for inline css background image and relative properties.