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%
Build a scrollable container that automatically adjusts its scroll boundaries when content is dynamically added or removed through DOM manipulation.
Create a scrollable list component that handles dynamic content updates. The component should:
The solution should handle scenarios where JavaScript code adds new elements, removes existing elements, or modifies the DOM structure of the scrollable content area.
@generates
/**
* Creates a dynamic scrolling container that automatically adjusts to DOM changes
*
* @param {string|HTMLElement} wrapper - The wrapper element selector or DOM element
* @param {Object} options - Configuration options
* @returns {Object} The scroll instance with control methods
*/
function createDynamicScroller(wrapper, options) {
// Implementation
}
/**
* Adds a new item to the scrollable list
*
* @param {Object} scroller - The scroll instance
* @param {string} itemText - Text content for the new item
*/
function addItem(scroller, itemText) {
// Implementation
}
/**
* Removes an item from the scrollable list
*
* @param {Object} scroller - The scroll instance
* @param {number} index - Index of item to remove
*/
function removeItem(scroller, index) {
// Implementation
}
module.exports = {
createDynamicScroller,
addItem,
removeItem
};Provides smooth scrolling with automatic DOM observation capabilities.
@satisfied-by
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