Test if an HTMLElement has either vertical and horizontal scrollbars.
Parameters:
Name | Type | Description |
---|---|---|
el | HTMLElement | The element to check against. |
- Since
- 1.0.0
- Source
Returns:
An object containing booleans for vertical and horizontal scrollbar existence.
- Type:
- object
Example
import { getNodes, hasScrollbar } from "@gravityforms/utils";
function Example() {
const node = getNodes( 'example' )[ 0 ];
const scrollInfo = hasScrollbar( node );
if ( scrollInfo.vertical || scrollInfo.horizontal ) {
//do something
}
}