diff --git a/sticky-header.js b/sticky-header.js index 4b0b1fd..8d9bab4 100644 --- a/sticky-header.js +++ b/sticky-header.js @@ -46,7 +46,7 @@ var jQuery = require('jquery'); return false; } - var scrollbarVerticalPosition = $body.scrollTop(); + var scrollbarVerticalPosition = $(window).scrollTop(); var isSticky = false; var isScrollingDown = scrollbarVerticalPosition > scrollbarPreviousVerticalPosition;