Image

Background Image Loading Eager

Loading Lazy Attribute

Image

Picture with Srcset

Background Image

Background Image

Background Image with Srcset

Background Picture

Background Picture with Srcset

Background Picture with Multiple Sources

uk-img with Image element (Deprecated)

Image

Picture with Srcset

Heading

Lorem ipsum dolor sit amet.

Heading

Lorem ipsum dolor sit amet.

Heading

Lorem ipsum dolor sit amet.

Heading

Lorem ipsum dolor sit amet.

1

2

3

4

5

6

7

8

9

10

JavaScript Options

Option Value Default Description
dataSrc String The image's `src` attribute.
sources String The image's sources. This option is used for background images only. The sources attributes be passed in `key: value;` format for a single source. For multiple sources in JSON format.
loading String lazy Enable lazy/eager loading. Set to `eager` for images within the first visible viewport.
margin String 50% The margin increases the viewport's bounding box, before computing an intersection with the image. (Must be px or % units)
target Boolean, String false A list of targets who's bounding boxes will be used to compute an intersection with the image. (Defaults to the image itself)