Skip to content

onAncestorScrollOrResize

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

Import:

import { onAncestorScrollOrResize } from 'obsidian-dev-utils/html-element';

Signature:

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

Parameters:

ParameterTypeDescription
nodeNodeThe node to add the event listener to.
callback() => voidThe callback to call when the event is triggered.

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