Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 1.87 KB

Layout.md

File metadata and controls

65 lines (49 loc) · 1.87 KB

@squirrel-forge/ui-util

Back to table of contents

Documentation

Javascript / Layout

HTTP <[ Layout ]> Logic

Table of contents


getScrollbarWidth

getScrollbarWidth - Get current scrollbar width

Description

getScrollbarWidth() // Number

Get the current device scrollbar width, creating some hidden elements and measuring the difference.

Parameters

The function has no parameters.

Return Values

Type/Value Description
Number Scrollbar width in pixels

Examples

getScrollbarWidth(); // 16

getVisibility

getVisibility - Get element vertical visibility

Description

getVisibility( elem, container = null ) // Object

Get element vertical visibility, considering scroll position, supplies relative and absolute values.

Parameters

Parameter Type Default Description
elem HTMLElement - Element to get visibility data for
container HTMLElement documentElement Relative container

Return Values

Type/Value Description
Object Visibility object { elem : Number %, view : Number %, height : Number pixels }

Examples

getVisibility( document.getElementById( 'section' ) ); // { elem : 27.4578567, view : 42.5678, height : 347 }

HTTP <[ Layout ]> Logic