onScroll([callback], [remove])
Class: ScrollPane. Method inherited from UIComponent.
Description:
Gets, registers or unregisters an event handler function for scrolling of vertical and/or horizontal scroll bars. Applicable only to components with scroll bars.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
The event handler function that receives a ScrollEvent object. Pass |
|
|
|
boolean |
false |
Set to |
Returns:
An array of handler functions if no arguments are passed, otherwise this component for method chaining.
Type: this | Array.<function()>
Examples:
// Example event object:
const e = {
target: object, // The component that triggered the event.
type: string, // `horizontal`, `vertical`.
x: number, // New value of horizontal scroll position
y: number, // New value of vertical scroll position
maxX: number, // Maximum value of horizontal scroll position
maxY: number // Maximum value of vertical scroll position
};
