Geometry
Positions, sizes and offsets.
Functions
Util.absoluteX
Definition
- Name
- Util.absoluteX
- Shorthand
- u.absX
- Syntax
- Number = Util.absoluteX( Node node );
Description
Get absolute x coordinate of Node, relative to top/left corner of page.
Parameters
- node
-
Node node to get absolute x coordinate of
Return values
Number absolute x coordinate in pixels
Examples
none
Dependencies
JavaScript
- document.offsetParent
- document.offsetLeft
Manipulator
none
Util.absoluteY
Definition
- Name
- Util.absoluteY
- Shorthand
- u.absY
- Syntax
- Number = Util.absoluteY( Node node );
Description
Get absolute y coordinate of Node, relative to top/left corner of page.
Parameters
- node
-
Node node to get absolute x coordinate of
Return values
Number absolute y coordinate in pixels
Examples
none
Dependencies
JavaScript
- document.offsetParent
- document.offsetTop
Manipulator
none
Util.relativeX
Definition
- Name
- Util.relativeX
- Shorthand
- u.relX
- Syntax
- Number = Util.relativeX( Node node );
Description
Get relative x coordinate of Node, relative to first relative/absolute node. This is the value you can use to position a node absolute, to keep it in the same place. Why? If you want to absolutely position a static node.
Parameters
- node
-
Node node to get relative x coordinate of
Return values
Number relative x coordinate in pixels
Examples
none
Dependencies
JavaScript
- document.offsetParent
- document.offsetLeft
- String.match
Manipulator
- Util.getComputedStyle
Util.relativeY
Definition
- Name
- Util.relativeY
- Shorthand
- u.relY
- Syntax
- Number = Util.relativeY( Node node );
Description
Get relative y coordinate of Node, relative to first relative/absolute node. This is the value you can use to position a node absolute, to keep it in the same place. Why? If you want to absolutely position a static node.
Parameters
- node
-
Node node to get relative y coordinate of
Return values
Number relative y coordinate in pixels
Examples
none
Dependencies
JavaScript
- document.offsetParent
- document.offsetTop
- String.match
Manipulator
- Util.getComputedStyle
Util.actualWidth
Definition
- Name
- Util.actualWidth
- Shorthand
- u.actualW
- Syntax
- Number = Util.actualWidth( Node node );
Description
Get the actual width of node - meaning the CSS width, excluding padding. Not to be confused with offsetWidth.
Parameters
- node
-
Node node to get width of
Return values
Number actual width of node in pixels.
Examples
none
Dependencies
JavaScript
- parseInt
Manipulator
- Util.getComputedStyle
Util.actualHeight
Definition
- Name
- Util.actualHeight
- Shorthand
- u.actualH
- Syntax
- Number = Util.actualHeight( Node node );
Description
Get the actual height of node - meaning the CSS height, excluding padding. Not to be confused with offsetHeight.
Parameters
- node
-
Node node to get height of
Return values
Number actual height of node in pixels
Examples
none
Dependencies
JavaScript
- parseInt
Manipulator
- Util.getComputedStyle
Util.eventX
Definition
- Name
- Util.eventX
- Shorthand
- u.eventX
- Syntax
- Number = Util.eventX( Event event );
Description
Get absolute x coordinate of event.
Parameters
- event
-
Event event to get x coordinate of
Return values
Number x coordinate of event
Examples
none
Dependencies
JavaScript
- event.targetTouches
- event.pageX
- event.clientX
- document.documentElement.scrollLeft
Manipulator
none
Util.eventY
Definition
- Name
- Util.eventY
- Shorthand
- u.eventY
- Syntax
- Number = Util.eventY( Event event );
Description
Get absolute y coordinate of event.
Parameters
- event
-
Event event to get y coordinate of
Return values
Number y coordinate of event
Examples
none
Dependencies
JavaScript
- event.targetTouches
- event.pageY
- event.clientY
- document.documentElement.scrollTop
Manipulator
none
Util.browserWidth
Definition
- Name
- Util.browserWidth
- Shorthand
- u.browserW
- Syntax
- Number = Util.browserWidth();
Description
Get inner width of browser window
Parameters
No parameters
Return values
Number width of browser window in pixels
Examples
none
Dependencies
JavaScript
- document.documentElement.clientWidth
Manipulator
none
Util.browserHeight
Definition
- Name
- Util.browserHeight
- Shorthand
- u.browserH
- Syntax
- Number = Util.browserHeight();
Description
Get inner height of browser window
Parameters
No parameters
Return values
Number height of browser window in pixels
Examples
none
Dependencies
JavaScript
- document.documentElement.clientHeight
Manipulator
none
Util.htmlWidth
Definition
- Name
- Util.htmlWidth
- Shorthand
- u.htmlW
- Syntax
- Number = Util.htmlWidth();
Description
Get width of HTML document in pixels. Basically this is the width of document.body, including margin.
Parameters
No parameters
Return values
Number width of HTML document, including margin.
Examples
none
Dependencies
JavaScript
- parseInt
- document.body.offsetWidth
Manipulator
- Util.getComputedStyle
Util.htmlHeight
Definition
- Name
- Util.htmlHeight
- Shorthand
- u.htmlH
- Syntax
- Number = Util.htmlHeight();
Description
Get height of HTML document in pixels. Basically this is the height of document.body, including margin.
Parameters
No parameters
Return values
Number height of HTML document, including margin.
Examples
none
Dependencies
JavaScript
- parseInt
- document.body.offsetWidth
Manipulator
- Util.getComputedStyle
Util.pageScrollX
Definition
- Name
- Util.pageScrollX
- Shorthand
- u.scrollX
- Syntax
- Number = Util.pageScrollX();
Description
Get vertical (x) scroll offset in pixels - how much has the page been scrolled sideways.
Parameters
No parameters
Return values
Number x scroll offset in pixels
Examples
none
Dependencies
JavaScript
- window.pageYOffset
- document.documentElement.scrollLeft
Manipulator
none
Util.pageScrollY
Definition
- Name
- Util.pageScrollY
- Shorthand
- u.scrollY
- Syntax
- Number = Util.pageScrollY();
Description
Get horisontal (y) scroll offset in pixels - how much has the page been scrolled down.
Parameters
No parameters
Return values
Number y scroll offset in pixels
Examples
none
Dependencies
JavaScript
- window.pageYOffset
- document.documentElement.scrollLeft
Manipulator
none
Files
Main file
- u-geometry.js
Segment support files
- u-geometry-desktop_ligth.js
Segment dependencies
- desktop_edge
- u-geometry.js + u-dom.js
- desktop_ie11
- u-geometry.js + u-dom.js
- desktop
- u-geometry.js + u-dom.js
- desktop_ie10
- u-geometry.js + u-dom.js + u-dom-desktop_ie.js
- desktop_ie9
- u-geometry.js + u-dom.js + u-dom-desktop_ie.js
- desktop_light
- u-geometry.js + u-geometry-desktop_light.js + u-dom.js + u-dom-desktop_light.js
- tablet
- u-geometry.js + u-dom.js
- tablet_light
- u-geometry.js + u-dom.js
- smartphone
- u-geometry.js + u-dom.js
- mobile
- not tested
- mobile_light
- not tested
- tv
- u-geometry.js + u-geometry-desktop_light.js + u-dom.js + u-dom-desktop_light.js
- seo
- not supported