FixWheel
Constructor
new FixWheel()
Methods
checkOverflow
checkOverflow(el) → {HTMLElement}
check the overflow. If it is scroll
or auto
, check the scrollOffset.
If the element is scrollable, apply scrollTop, otherwise check the parentNode
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLElement | the starts a the |
Returns:
Returns the original element or the next scrollable ancestor.
Returns null
if no element matched the criteria.
- Type
- HTMLElement
destroy
destroy() → {Boolean}
destroys the helper. removes the fix if it has been applied
Returns:
should always return false
.
Mainly used for debugging but can be used as a flag.
- Type
- Boolean
fixWheel
fixWheel(e)
the actual fix for the issue.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
e |
Object | mousewheel event Properties
|
init
init(rootNode) → {Boolean}
this method applys the fix for wheel events in browsers with faulty implementation
Parameters:
Name | Type | Description |
---|---|---|
rootNode |
HTMLElement | a DOM node, usually |
Returns:
returns true
when applied, otherwise false
.
Mainly used for debugging but can be used as a flag.
- Type
- Boolean
preventDefault
preventDefault(e)
prevent the default event
Parameters:
Name | Type | Description |
---|---|---|
e |
Object | mousewheel event |