Skip to content

Commit

Permalink
Fixes issue with highlighting when body & html have both height set t…
Browse files Browse the repository at this point in the history
…o "100%"
  • Loading branch information
arielsalminen committed May 5, 2014
1 parent af8ca51 commit 3d36011
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/fixed-responsive-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,16 @@

// Determine viewport and body size
var top = window.pageYOffset,
bodyheight = document.body.offsetHeight,
viewport = window.innerHeight;
body = document.body,
html = document.documentElement,
viewport = window.innerHeight,
bodyheight = Math.max(
body.scrollHeight,
body.offsetHeight,
html.clientHeight,
html.scrollHeight,
html.offsetHeight
);

// For each content link, when it's in viewport, highlight it
if (!wasNavigationTapped) {
Expand Down

0 comments on commit 3d36011

Please sign in to comment.