scroll-active
Version:
A lightweight lib for making navigation elements active as you scroll.
40 lines (39 loc) • 803 B
TypeScript
/**
* scroll active 初始化配置
*
* @export
* @class ActiveOptions
*/
export default class ActiveOptions {
/**
* 导航容器,当有多个导航的时候非常有用
*
* @type {(HTMLElement)}
* @memberof ActiveOptions
*/
wrapper: HTMLElement;
/**
* 触发 active 时给元素添加的 className
*
* @memberof ActiveOptions
*/
activeClass: string;
/**
* 触发 active 的偏移量
*
* @memberof ActiveOptions
*/
offset: number;
/**
* 点击导航,是否改变 hash
*
* @memberof ActiveOptions
*/
hash: boolean;
/**
* active 项改变时触发
*
* @memberof ActiveOptions
*/
update?: (id: string) => void;
}