UnderZ

Javascript Library.

Scroll page/element.

Page/Element scroll.


Scroll page to element

_z.scrollTo(where);

Returns: _z(where) or _z(window) Object

This method is a shortcut for _z(window).scrollTo(where).


Scroll element

_z(selector).scrollTo(where);

Returns: Object _z(selector)


Examples

<textarea class="textarea">
line 1
line 2
line 3
line 4
</textarea>
<input type="text" id="text" value="Scroll to here">

<script>
// scroll textarea to 10px
_z(".textarea").scrollTo(10);

// scroll page to text input
_z.scrollTo("#text");

// scroll page to textarea
_z.scrollTo( _z(".textarea") );
</script>