Lazy loading assets is the act of deferring the loading of the assets until the time that they are actually needed.
loading
attribute is supported by most of the popular Chromium-powered browsers (Chrome, Edge, Opera) and Firefox. To learn more about what browsers are supported you can visit caniuse.com. Browsers that do not support the loading
attribute will simply ignore it without side-effects.
show_loading
and loading
keys to the image or logo field in the module’s fields.json
file.
Parameter | Type | Description | Default |
---|---|---|---|
show_loading | Boolean | Controls showing/hiding lazy load controls to the content editor. | False |
loading | String | Determines whether to use lazy loading. Options include: "disabled" or "lazy" | "disabled" |
module.html
file using the following syntax:
loading
attribute in the browser. Options for this include “Default” (default option) which is the default browser loading behavior for the asset. When enabling lazy loading, the image will load once the image reaches a certain distance from the viewport as defined in the distance-from-viewport threshold.
module.html
file using the following syntax: