Skip to content

Instantly share code, notes, and snippets.

@stereokai
Last active January 17, 2016 16:09
Show Gist options
  • Select an option

  • Save stereokai/b31a630b3a8ca00a04b2 to your computer and use it in GitHub Desktop.

Select an option

Save stereokai/b31a630b3a8ca00a04b2 to your computer and use it in GitHub Desktop.

Revisions

  1. stereokai renamed this gist Jan 17, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. stereokai created this gist Jan 17, 2016.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function getScrollTop() {
    return (isBlink || isSafari || isEdge) ? document.body.scrollTop
    : document.documentElement.scrollTop;
    }

    function setScrollTop(scrollTop) {
    if (isBlink || isSafari || isEdge) {
    document.body.scrollTop = scrollTop;
    } else {
    document.documentElement.scrollTop = scrollTop;
    }
    }