estimancy/projestimate

View on GitHub
app/assets/javascripts/scroll.js

Summary

Maintainability
A
0 mins
Test Coverage
$(document).ready(function () {
    window.scroll(0, getPageScroll());
});

//this function simply gets the window scroll position, works in all browsers
function getPageScroll() {
    var yScroll;
    if (self.pageYOffset) {
        yScroll = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        yScroll = document.documentElement.scrollTop;
    } else if (document.body) {
        yScroll = document.body.scrollTop;
    }
    return yScroll
}