Optional
props: StaticProps & MutablePropsProtected
_callbacksCallbacks instance
Protected
_destroyableStores actions that need to be executed when the module is destroyed
Protected
_elementsArray of marquee element nodes
Protected
_initialInitial child nodes of the container
Protected
Optional
_intersectionIntersection observer
Protected
_isTracks whether the module has been destroyed
Protected
Optional
_lastLast setup handler for teardown
Protected
_propsCurrent properties
Protected
_rafRaf instance
Protected
_totalTotal width of all elements in the marquee
Protected
_widthCurrent container width
Protected
_widthsArray of widths of each child element
Protected
_xThe current X coordinate of the marquee.
Retrieves the module's callbacks instance.
Checks if the module has been destroyed.
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps
instead.
Total width of all elements in the marquee
The current X coordinate of the marquee.
Protected
_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected
_applyAdds necessary styles to a given element.
Protected
_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected
_destroyDestroys the instance and cleans up resources
Get default mutable properties.
Get default static properties.
Protected
_handleHandle intersection observer
Protected
_handleHandles property changes
Protected
_renderRenders the marquee, calculating element positions based on the provided speed.
Protected
_setupInitializes the marquee setup, including resizing and cloning elements
Protected
_wrapWraps the first text node in the container in a span if no other elements exist.
Destroys the module, cleaning up resources, callbacks, and event listeners.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Renders the marquee, adjusting element positions.
Optional
step: numberResizes the marquee, recalculating element positions and cloning if necessary.
A custom marquee component that smoothly scrolls its child elements.
This component is designed to loop elements horizontally within a container, with support for customization such as speed, gap, pause on hover, and more.
Documentation