A TypeScript plugin for BetterScroll that provides enhanced mouse wheel scrolling capabilities with configurable speed, direction, easing, and boundary damping on PC platforms.
Overall
score
98%
A utility that creates a scrollable container with customizable scroll boundaries using BetterScroll's boundary computation hooks.
@generates
export interface BoundaryModifier {
multiplier?: number;
offset?: number;
}
export class DynamicScrollController {
/**
* Creates a new scroll controller with dynamic boundary modification
* @param wrapperEl - The wrapper element selector or HTMLElement
* @param contentEl - The content element selector or HTMLElement (optional)
* @param options - BetterScroll options (optional)
*/
constructor(wrapperEl: string | HTMLElement, contentEl?: string | HTMLElement, options?: any);
/**
* Sets boundary modification parameters
* @param modifier - Object containing multiplier and/or offset for boundary modification
*/
setBoundaryModifier(modifier: BoundaryModifier): void;
/**
* Refreshes the scroll instance to recalculate boundaries
*/
refresh(): void;
/**
* Gets the current scroll boundaries
* @returns Object with maxScrollY and minScrollY
*/
getBoundaries(): { maxScrollY: number; minScrollY: number };
/**
* Gets the underlying BetterScroll instance
*/
getScrollInstance(): any;
/**
* Destroys the scroll instance and cleans up
*/
destroy(): void;
}Provides the core scrolling functionality with hook system for boundary computation.
{
"@better-scroll/core": "^2.5.0"
}Install with Tessl CLI
npx tessl i tessl/npm-better-scroll--mouse-wheeldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10