Test if an HTMLElement has either vertical and horizontal scrollbars.

Parameters:
NameTypeDescription
elHTMLElement

The element to check against.

Since
  • 1.0.0
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
 }
}