The parent EventDispatcher instance. If this instance has no parent, this value will be set to null. The parent is used in the bubbling and capturing phases of events.
Returns which axis this ScrollTracker instance is tracking.
Returns the target element this ScrollTracker instance is tracking.
Adds a new event listener. The given handler function will be called in the following cases:
The eventType to listen for
The handler function that will be called when a matching event is dispatched. This function will retrieve the dispatched [[IEvent|event]] as a parameter
Indicates if this handler should be called during the capturing phase of an event chain. If and only if this is set to false will this handler be called during the bubbling phase of an event chain.
A number that indicates the priority of this event listener relative to other event listeners of the same type on this EventDispatcher instance. A higher number indicates that this listener will be called earlier.
An object describing the listener that has a [[EventListenerData.dispose|dispose()]] method to remove the listener.
Adds a new point of which we will detect when it enters and leaves the view.
The position of this points in pixels. This is the distance from the start or end of the target element depending on the 'side' parameter, measured horizontally or vertically depending on the axis of this ScrollTracker instance.
The side from which the 'position' parameter is defined. Side.START measures the position from the top or left edge and Side.END will measure the position from the bottom or right edge.
A reference to a ScrollTrackerPoint instance that can be used to bind events, remove or update the point added.
Dispatches the given event. The dispatch consists of three phases:
If any of the event handlers call [[IEvent.stopPropagation|stopPropagation()]], we will skip all event handlers that occur on a target later in the event chain. If an event handler calls [[IEvent.stopImmediatePropagation|stopImmediatePropagation()]], we will also skip any event handlers on the same target in the event chain.
The event to dispatch
If one of the handlers that have been called during this dispatch called [[IEvent.preventDefault|event.preventDefault()]], this method will return false. If no handlers have been called or none of the handlers have called [[IEvent.preventDefault|event.preventDefault()]], this method will return true.
Please note: [[IEvent.preventDefault|preventDefault()]] can only be called on events that have their [[IEvent.cancelable|cancelable]] property set to true
Disposes this ScrollTracker and all points created on it. Removes all event handlers.
Checks if an event listener matching the given parameters exists on this EventDispatcher instance.
Will only look for event listeners with this eventType
If set, will only match event listeners that have the same handler function
If set, will only match event listeners that have the same useCapture argument. Please note: if no useCapture argument was provided to addEventListener, it is set to false by default
True if one or more event listeners exist
Initialize scroll and resize events using jQuery. Resize events will only be used when the target of ScrollTracker is 'window'. If the target is not window, updateSize() has to be called manually to update the view size.
After dispose has been called, this method returns true. Use this method to determine whether dispose() should be run again.
Handles events thrown by ScrollTrackerPoint instances and bubbles them up to this ScrollTracker instance.
The event thrown.
Removes all event listeners that have a [[IEvent.type|type]] of the given eventType from this EventDispatcher instance, regardless of their [[EventListenerData.handler|handler]] or [[EventListenerData.useCapture|useCapture]] property.
Please note: if you remove an event listener during the dispatch of an event it will not be called anymore, even if it was supposed to be called in the same event chain
The [[IEvent.type|type]] of event to remove. If not provided, all event listeners will be removed regardless of their type.
Removes all points from this ScrollTracker instance. They will be destructed and will no longer throw events.
Removes all event listeners that match the given parameters from this EventDispatcher instance.
Please note: if you remove an event listener during the dispatch of an event it will not be called anymore, even if it was supposed to be called in the same event chain
Only event listeners of that have this eventType are removed
Only event listeners that have this handler function will be removed
Only event listeners that have been added with the same useCapture parameter will be removed. Please note: if no useCapture argument is provided, only event listeners that have useCapture set to false will be removed.
Removes an existing point from this ScrollTracker. This point will be destructed and will no longer throw events.
The ScrollTrackerPoint instance to remove.
Boolean indicating if the point was found and removed successfully.
Event handler called when the target element is scrolled. Will detect the new scroll position and call checkInView() on all tracking points.
Updates the size of the viewport of the target element.
Checks if an event listener with a [[EventListenerData.type|type]] of the given eventType exists on this EventDispatcher or any ancestor EventDispatcher instance.
The event type to check for
true if a matching listener is found
Event handler called when the window resizes. Only used when the target of this ScrollTracker instance is the window object.
Generated using TypeDoc
Class that keeps track of the vertical scroll position of an element.