Infinite scroll

Vue Bootstrap 5 Infinite scroll

Bootstrap 5 Lazy Loading is a feature, that allows you to load images or videos only when they are visible on the screen.

Note: Read the API tab to find all available options and advanced customization


Basic example

Lazy Loading will automatically initialize after adding v-mdb-lazy directive to your img or video element. It is important to add src binding value - otherwise, Lazy Load will throw an error.

Scroll down to see an image

Example image

Offset

Use offset binding value to define an additional amount of pixels after which image or video will show.

Scroll more down to load a picture.

Example image

Error

Use error binding value to define a picture that will show if image or video doesn't load.

Example image

Animations

Use animation binding value to specify which animation you want to activate when element loads.

Example image
Example image

Container

Initialize a set of elements at once by adding v-mdb-lazy directive to their container. If you set attributes in the parent, all of img and video elements inside will inherit them. You can overwrite them by declaring these attributes in inner elements as data-lazy-"name of binding value"

Example image Example image

Infinite scroll - API


Import


        import { mdbLazy } from "mdb-vue-ui-kit";
      

Properties

Property Type Default Description
src String '' Defines the source of an element
placeholder String '' Defines a picture that is shown before loading a proper element
error String '' Defines a picture that is shown if an error with showing element occurs
delay Number 500 Defines delay after which element will show
offset Number 0 Defines an additional offset after which element will show
media Number 0 Set the minimum width in pixels for which the sticky should work
animation String '' Defines animation during element showing