Skip to content

Commit

Permalink
Merge pull request #13 from pbock/fix-negative-scroll
Browse files Browse the repository at this point in the history
Fix negative scroll (e.g. in OS X browsers)
  • Loading branch information
RobertoGonzalez committed Sep 30, 2014
2 parents c1997b9 + db19e7c commit b1e4bad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions midnight.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@

// Check classes are currently active in the header (including the current percentage of each)
scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
// Some browsers (e.g on OS X) allow scrolling past the top/bottom.
scrollTop = Math.max(scrollTop, 0);
scrollTop = Math.min(scrollTop, $(document).height());

// Get the header's position relative to the document (given that it's fixed)
var headerHeight = headerInfo.height;
Expand Down
2 changes: 1 addition & 1 deletion midnight.jquery.min.js

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

0 comments on commit b1e4bad

Please sign in to comment.