Skip to content

Commit

Permalink
Added offset option to scroll a little more for sticky headers
Browse files Browse the repository at this point in the history
  • Loading branch information
floorish committed Sep 24, 2014
1 parent 6b54a5e commit 9a634db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 3 additions & 2 deletions smooth-scroll.js
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
* Smooth Scroller Script, version 1.0.1
* Smooth Scroller Script, version 1.0.2
* (c) 2007 Dezinerfolio Inc. <midart@gmail.com>
* Edited by @floorish
*
Expand All @@ -11,6 +11,7 @@ Scroller = {
// control the speed of the scroller.
// dont change it here directly, please use Scroller.speed=50;
speed:10,
offset:0,

// returns the Y position of the div
gy: function (elem) {
Expand All @@ -20,7 +21,7 @@ Scroller = {
y += elem.offsetTop;
}
}
return y;
return y - this.offset;
},

// returns the current scroll position
Expand Down
9 changes: 2 additions & 7 deletions smooth-scroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a634db

Please sign in to comment.