From: zurbchris Date: Thu, 14 Mar 2013 21:38:15 +0000 (-0700) Subject: updating topbar fixed bug X-Git-Tag: v4.0.7~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19e726f4309cc440ae0a7b44661bb835807e9aec;p=thirdparty%2Ffoundation%2Ffoundation-sites.git updating topbar fixed bug --- diff --git a/js/foundation/foundation.topbar.js b/js/foundation/foundation.topbar.js index e39f9e6d2..519cbeeb9 100644 --- a/js/foundation/foundation.topbar.js +++ b/js/foundation/foundation.topbar.js @@ -82,11 +82,6 @@ section.find('li.moved').removeClass('moved'); topbar.data('index', 0); } - - if (topbar.parent().hasClass('fixed')) { - topbar.parent().toggleClass('fixed'); - $('body').css('padding-top', 0); - } }) .on('click.fndtn.topbar', '.top-bar .has-dropdown>a', function (e) { @@ -172,6 +167,9 @@ // check for sticky this.sticky(); + + // check for fixed + this.fixed(); }, largestUL : function () { @@ -213,7 +211,16 @@ }, fixed : function() { - + if (topbar.parent().hasClass('fixed')) { + var offst = this.outerHeight($('nav.top-bar'))+20; + topbar.parent().toggleClass('fixed'); + $('body').css('padding-top', 0); + window.scrollTo(0); + } + else { + topbar.parent().toggleClass('fixed'); + $('body').css('padding-top',offst); + } }, off : function () {