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).

If you need to call the given function not only when intersecting, but also immediately after the directive has been inserted, use start modifier

If you need to call the given function only once when intersecting and then never again, use once modifier