...
Code Block |
---|
// Scrolls straight from current page Y coordinate to specified element Y coordinate. // Dependencies: elemYPosition() // roughScroll( string elementID ) function roughScroll(eID) { var stopY = parseInt(elmYPosition(eID)); stopY = stopY - parseInt(window.screen.heightinnerHeight / 2); window.scrollTo(0, stopY); } |
...