Skip to content

Scroll

getScrollPosition

获取滚动条位置 EN: Return the current scroll position {x,y} for the given window-like object.

/**
* 获取滚动条位置
* @param el 默认window
* @returns Position
* @description EN: Return the current scroll position {x,y} for the given window-like object.
*/

scrollToTop

滚动到顶部 EN: Smoothly scroll the document to the top using a requestAnimationFrame loop.

/**
* 滚动到顶部
* @description EN: Smoothly scroll the document to the top using a requestAnimationFrame loop.
*/

scrollToView

滚动到可视区域 EN: Smoothly scroll the given element or selector into view with optional options.

/**
* 滚动到可视区域
* @param { Element | string | null } e 元素
* @param { ScrollIntoViewOptions } options {
* block?: ScrollLogicalPosition;
* inline?: ScrollLogicalPosition;
* }
* @returns void
* @description EN: Smoothly scroll the given element or selector into view with optional options.
*/

getScrollProgress

暂无文档注释,欢迎补充。