From: Afonso Duarte Date: Tue, 8 Dec 2015 13:53:15 +0000 (+0000) Subject: Fixes #7449 [Magellan] Last menu element active on load if body has no margin X-Git-Tag: v6.0.6~55^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7450%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fixes #7449 [Magellan] Last menu element active on load if body has no margin Uses document.documentElement.clientHeight to calculate viewport height instead of document.body.clientHeight. See http://jsfiddle.net/tzdcx/1/ for differences between the two. --- diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index a9620337c..db05a17a5 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -93,7 +93,7 @@ html = document.documentElement; this.points = []; - this.winHeight = Math.round(Math.max(window.innerHeight, document.body.clientHeight)); + this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); this.$targets.each(function(){