getScrollbarWidth - Get current scrollbar width
getScrollbarWidth() // NumberGet the current device scrollbar width, creating some hidden elements and measuring the difference.
The function has no parameters.
| Type/Value | Description |
|---|---|
| Number | Scrollbar width in pixels |
getScrollbarWidth(); // 16getVisibility - Get element vertical visibility
getVisibility( elem, container = null ) // ObjectGet element vertical visibility, considering scroll position, supplies relative and absolute values.
| Parameter | Type | Default | Description |
|---|---|---|---|
| elem | HTMLElement | - | Element to get visibility data for |
| container | HTMLElement | documentElement | Relative container |
| Type/Value | Description |
|---|---|
| Object | Visibility object { elem : Number %, view : Number %, height : Number pixels } |
getVisibility( document.getElementById( 'section' ) ); // { elem : 27.4578567, view : 42.5678, height : 347 }