Skip to content

onAncestorScrollOrResize

Adds an event listener to the ancestor nodes of the given node.

Import:

import { onAncestorScrollOrResize } from '@mnaoumov/typescript-lib/html-element';

Signature:

function onAncestorScrollOrResize(node: Node, callback: () => void): Disposable

Parameters:

Parameter Type Description
node Node The node to add the event listener to.
callback () => void The callback to call when the event is triggered.

Returns: Disposable — A Disposable that removes the event listeners when disposed, for use with using.