Intersection Observer
Vue Bootstrap 5 Intersection Observer
mdbIntersectionObserver
is a custom directive which allows calling a method when an element is visible on the screen.
Basic usage
Import the directive from mdb-vue-ui-kit
and add mdbIntersectionObserver
to the directives
object. Now you can attach the directive to any html element or component. Check the console to see the result (F12).
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.
If you need to call the given function not only when intersecting, but also immediately after the directive has been inserted, use start
modifier
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.
If you need to call the given function only once when intersecting and then never again, use once
modifier
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.