xxm-test-js
Version:
xxm-js通用js工具(utils)库
24 lines (23 loc) • 824 B
TypeScript
/**
* 滚动到容器底部。
* @param {HTMLElement | Window} [container=window] - 要滚动的容器,默认为window。
* @param {ScrollToOptions} [options={ behavior: 'smooth' }] - 滚动选项。
* @returns {Promise<void>} - 滚动完成的Promise。
* @example
* ```javascript
* // 使用示例
* // 滚动到页面底部
* scrollToBottom().then(() => {
* // 滚动完成后执行其他操作
* console.log('已滚动到页面底部');
* });
*
* // 滚动到指定元素的底部
* const element = document.getElementById('myElement');
* scrollToBottom(element).then(() => {
* // 滚动完成后显示提示信息
* alert('已滚动到指定元素底部');
* });
* ```
*/
export declare function scrollToBottom(container?: HTMLElement | Window, options?: ScrollToOptions): Promise<void>;