Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Add offsettTop to offsetHeight for scrollHeader #36

Merged
merged 1 commit into from
Feb 19, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ window.smoothScroll = (function (window, document, undefined) {

// Get the height of a fixed header if one exists
var scrollHeader = document.querySelector('[data-scroll-header]');
var headerHeight = scrollHeader === null ? 0 : scrollHeader.offsetHeight;
var headerHeight = scrollHeader === null ? 0 : (scrollHeader.offsetHeight + scrollHeader.offsetTop);

// Set the animation variables to 0/undefined.
var timeLapsed = 0;
Expand Down