utils/dom/scroll
@ckeditor/ckeditor5-utils/src/dom/scroll
Filtering
Functions
-
scrollAncestorsToShowTarget( target )
Makes any page
HTMLElement
orRange
(target) visible within its scrollable ancestors, e.g. if they haveoverflow: scroll
CSS style.Parameters
target : HTMLElement | Range
A target, which supposed to become visible to the user.
-
scrollViewportToShowTarget( options.target, [ options.viewportOffset ] )
Makes any page
HTMLElement
orRange
(target
) visible inside the browser viewport. This helper will scroll alltarget
ancestors and the web browser viewport to reveal the target to the user. If thetarget
is already visible, nothing will happen.Parameters
options.target : HTMLElement | Range
A target, which supposed to become visible to the user.
[ options.viewportOffset ] : Number
An offset from the edge of the viewport (in pixels) the
target
will be moved by when the viewport is scrolled. It enhances the user experience by keeping thetarget
some distance from the edge of the viewport and thus making it easier to read or edit by the user.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.