Namespace: window

xslet. window

Is the namespace for window informations and operations.

Properties:
Name Type Description
unitOfSize string

The unit of size used in a whole of HTML page.

rootFontSize number

The root font size. This value is a number, and can be specified as a number or a string of which format is value + unit. The unit allowed is either 'px', 'mm' or 'rem'.

scrollbarWidth number

The scroll bar width. The unit of this value is same with unitOfSize property. This value can be updated by re-layouting a page, because some browsers change its scroll bar width by zooming. (read only)

scrollLeft number

The horizontal scroll position of window. The unit of this value is same with unitOfSize property.

scrollTop number

The vertical scroll position of window. The unit of this value is same with unitOfSize property.

maxScrollLeft number

The maximum horizontal scroll position of window. The unit of this value is same with unitOfSize property. (read only)

maxScrollTop number

The maximum vertical scroll position of window. The unit of this value is same with unitOfSize property. (read only)

scrollWidth number

The width of scrollable area of window. The unit of this value is same with unitOfSize property. (read only)

scrollHeight number

The height of scrollable area of window. The unit of this value is same with unitOfSize property. (read only)

relayoutDelay number

The delay time to re-layout a page against resize events. The unit of this value is millisecond.

Methods


<static> addRelayoutListener(listener)

Adds a re-layout listener which is to be called when a browser is resized or xslet.window.relayout method is executed.

Parameters:
Name Type Description
listener function

A listener function.


<static> convertUnit(value, fromUnit, toUnit)

Converts value in fromUnit to new value in toUnit. The units allowed are either 'px', 'mm' and 'rem'.

Parameters:
Name Type Description
value number

A value to be converted.

fromUnit string

The unit of value.

toUnit string

The unit of value after converted.

Returns:

The value after converted.

Type
number

<static> relayout()

Re-layout a page. This method forcely executes re-layout listeners registered by addRelayoutListener method.


<static> removeRelayoutListener(listener)

Removes a registered re-layout listener.

Parameters:
Name Type Description
listener function

A listener function.