Class: IsInViewportMixinClass

@aofl/component-utils~ IsInViewportMixinClass


new IsInViewportMixinClass(args)

Creates an instance of IsInViewportMixinClass.
Parameters:
Name Type Argument Description
args * <repeatable>
Source:

Extends

  • superClass

Methods


addListeners()

Source:

checkInViewport()

Source:

connectedCallback(args)

Parameters:
Name Type Argument Description
args * <repeatable>
Source:

disconnectedCallback(args)

Parameters:
Name Type Argument Description
args * <repeatable>
Source:

firstUpdated()

Source:

<protected> firstWithinViewport()

firstWithinViewport() is invoked when the element scrolls into view for the first time. This function should be implemented by the sub class.
Source:

<protected> stopIsInViewportCheck()

When stopiIsInViewportCheck() is invoked it removes the event listeners and stops invoking the withinViewportUpdated() function. This is useful when we want to disconnect the event listeners and keep the component attached to dom. For example, consider lazy loading images with aofl-img. Once the image is loaded it is no longer necessary to check isInViewStatus.
Source:

<protected> withinViewportUpdated(newValue, oldValue)

withinViewportUpdated() is invoked anytime the element enters or exists the viewport. This function should be implemented by the sub class.
Parameters:
Name Type Description
newValue Boolean
oldValue Boolean
Source: