Window

The window object has its own portion of extensions in RightJS which help you to deal with sizes and scrolls in a cross-browser way.

Methods

scrollTo, scrolls, sizes

top ↑scrollTo

scrollTo(number left, number top) -> window self
scrollTo(Object {x: ..., y:...}) -> window self
scrollTo(Element element) -> window self
scrollTo(String element_id) -> window self

Description

Handles the main scrollbars of the window. Can scroll the window to any position or element.

Example

window.scrollTo(123, 123);
window.scrollTo({x: 123, y: 123});
window.scrollTo($('element'));
window.scrollTo('element-id');

top ↑scrolls

scrolls() -> Object {x: NN , y: NN }

Description

Returns the scroll offsets for the window.

Example

window.scrolls();

top ↑sizes

sizes() -> Object {x: NN , y: NN }

Description

Returns the internal space sizes of the window.

Example

window.sizes();