Team:Wageningen UR/templates/footer
From 2014.igem.org
(Difference between revisions)
Line 42: | Line 42: | ||
var divPos = $(theID).offset().top; // get the offset of the div from the top of page | var divPos = $(theID).offset().top; // get the offset of the div from the top of page | ||
var divHeight = $(theID).height(); // get the height of the div in question | var divHeight = $(theID).height(); // get the height of the div in question | ||
- | if (windowPos >= divPos | + | if (windowPos >= divPos){ |
- | + | if (windowPos < (divPos + divHeight)) { | |
+ | $("a[href='" + theID + "']").addClass("sidenav-active"); | ||
+ | } | ||
+ | else { | ||
+ | $("a[href='" + theID + "']").removeClass("sidenav-active"); | ||
+ | } | ||
} else { | } else { | ||
$("a[href='" + theID + "']").removeClass("sidenav-active"); | $("a[href='" + theID + "']").removeClass("sidenav-active"); |
Revision as of 12:27, 28 September 2014