MCPcopy Index your code
hub / github.com/prototypejs/prototype / scrollTo

Function scrollTo

src/prototype/dom/layout.js:1258–1263  ·  view source on GitHub ↗

* Element.scrollTo(@element) -> Element * * Scrolls the window so that `element` appears at the top of the viewport. * * This has a similar effect than what would be achieved using * [HTML anchors](http://www.w3.org/TR/html401/struct/links.html#h-12.2.3) * (except the browser'

(element)

Source from the content-addressed store, hash-verified

1256 * // -> Element
1257 **/
1258 function scrollTo(element) {
1259 element = $(element);
1260 var pos = Element.cumulativeOffset(element);
1261 window.scrollTo(pos.left, pos.top);
1262 return element;
1263 }
1264
1265
1266 /**

Callers 2

position.test.jsFile · 0.85
layout.test.jsFile · 0.85

Calls 1

$Function · 0.85

Tested by

no test coverage detected