]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
updating topbar fixed bug
authorzurbchris <chris@zurb.com>
Thu, 14 Mar 2013 21:38:15 +0000 (14:38 -0700)
committerzurbchris <chris@zurb.com>
Thu, 14 Mar 2013 21:38:15 +0000 (14:38 -0700)
js/foundation/foundation.topbar.js

index e39f9e6d213f3d7afdaf3792cce536b12bb9b106..519cbeeb935982f00acd5dcaee81fe6b8aee5b79 100644 (file)
             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) {
 
       // check for sticky
       this.sticky();
+
+      // check for fixed
+      this.fixed();
     },
 
     largestUL : function () {
     },
 
     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 () {