added sticky header via javascript since foundation sticky class doesn't appear to...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 19:33:37 +0000 (15:33 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 19:33:37 +0000 (15:33 -0400)
js/app.js
js/custom/pageSetup.js

index 2d7e1d0..4e4b110 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -50,4 +50,19 @@ $(document).ready(function () {
             this.title = $(this.element).find('img').attr('alt');
         }
     });
+        var body = $("body");
+    var sticky = $(".sticky");
+    $(window).on("scroll", function () {
+        var scrollTop = $(window).scrollTop();
+        if(scrollTop > 0){
+            $(sticky).addClass("fixed");
+            $(body).addClass("f-topbar-fixed");
+        } 
+//        if(scrollTop == 0){
+//            $(sticky).removeClass("fixed");
+//            $(body).removeClass("f-topbar-fixed");
+//        }
+        console.log(scrollTop);
+    });
+    
 });
index 2c77d7d..690bd36 100644 (file)
@@ -41,4 +41,19 @@ $(document).ready(function () {
             this.title = $(this.element).find('img').attr('alt');
         }
     });
+        var body = $("body");
+    var sticky = $(".sticky");
+    $(window).on("scroll", function () {
+        var scrollTop = $(window).scrollTop();
+        if(scrollTop > 0){
+            $(sticky).addClass("fixed");
+            $(body).addClass("f-topbar-fixed");
+        } 
+//        if(scrollTop == 0){
+//            $(sticky).removeClass("fixed");
+//            $(body).removeClass("f-topbar-fixed");
+//        }
+        console.log(scrollTop);
+    });
+    
 });