Context object.
An XPath selector pointing to the element to overlay with a highlight.
Optional
options: HighlightSelectorOptionsOptions for the highlight.
The Watcher instance observing the lifecycle of the element.
A highlight is a colored transparent marker that appears around an element. It point users to important data or fields that they should acknowledge, double-check, confirm, or edit. Highlights do not block clicks or other user actions.
The highlight will be applied and removed depending on element existence, and
it survives navigation. Optionally, pass ensureVisible
to apply the
highlight only to visible elements. The highlight is appended to the
element's scroll container and will follow scrolling and display with the
correct z-index.
The highlight will be started automaticaly, and it can be removed from the
DOM by calling stop()
.
const highlights = [
highlightXpath(ctx, '//div[@class="mySelector"]'),
highlightXpath(ctx, '//div[@class="myOtherSelector"]'),
];
// ...
for (let h of highlights) h.stop();
Generated using TypeDoc
Creates a visible highlight around an element by XPath selector.