From: Anthony Talarico Date: Wed, 3 Aug 2016 18:47:30 +0000 (-0400) Subject: added sticky class to header, not working with pure foundation so added javascript... X-Git-Tag: v1.0.0^2~182 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=136917769aec3826a2e7b14f232d3fe45f03b144;p=WP-Themes%2Fpetoskeyarea.git added sticky class to header, not working with pure foundation so added javascript to added a fixed class when scrolling and remove it if scrolltop is 0 --- diff --git a/front-page.php b/front-page.php index 822f9b0..330d428 100644 --- a/front-page.php +++ b/front-page.php @@ -48,6 +48,11 @@ +

From the Blog

diff --git a/header.php b/header.php index 842278a..5e29941 100644 --- a/header.php +++ b/header.php @@ -12,7 +12,9 @@
-
+
+
+
+
+
diff --git a/js/app.js b/js/app.js index aeaa0cd..556b8d5 100644 --- a/js/app.js +++ b/js/app.js @@ -192,21 +192,19 @@ $(document).ready(function () { slidesToScroll: 1 }); } - } + check_window_width(); $(window).resize(function () { check_window_width(); }); - var url = "https://api.hubapi.com/content/api/v2/blogs?hapikey=demo"; - -// $.ajax({ -// url: url, -// dataType: 'JSONP', -// jsonpCallback: 'callback', -// type: 'GET', -// success: function (data) { -// console.log(data); -// } -// }); + var sticky = $(".sticky"); + $(window).on("scroll", function () { + var scrollTop = $(window).scrollTop(); + if(scrollTop > 0){ + $(sticky).addClass("fixed"); + } else if(scrollTop <= 0){ + $(sticky).removeClass("fixed"); + } + }); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index a122c27..c7850db 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -183,21 +183,19 @@ $(document).ready(function () { slidesToScroll: 1 }); } - } + check_window_width(); $(window).resize(function () { check_window_width(); }); - var url = "https://api.hubapi.com/content/api/v2/blogs?hapikey=demo"; - -// $.ajax({ -// url: url, -// dataType: 'JSONP', -// jsonpCallback: 'callback', -// type: 'GET', -// success: function (data) { -// console.log(data); -// } -// }); + var sticky = $(".sticky"); + $(window).on("scroll", function () { + var scrollTop = $(window).scrollTop(); + if(scrollTop > 0){ + $(sticky).addClass("fixed"); + } else if(scrollTop <= 0){ + $(sticky).removeClass("fixed"); + } + }); }); diff --git a/parts/top-bar.php b/parts/top-bar.php index 985cd9b..1c4e28d 100644 --- a/parts/top-bar.php +++ b/parts/top-bar.php @@ -1,7 +1,9 @@ -