From 07292fdec707e69b93d16bd423eafcf5ec54786c Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 12 May 2016 13:16:20 -0400 Subject: [PATCH] added jquery to determine screen size and apply or remove sticky class to heaer --- header.php | 4 ++-- js/app.js | 15 +++++++++++++++ js/custom/pageSetup.js | 15 +++++++++++++++ parts/top-bar.php | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/header.php b/header.php index 0c57134..8f6fc8c 100644 --- a/header.php +++ b/header.php @@ -26,7 +26,7 @@
-
+
@@ -51,5 +51,5 @@
-
+ diff --git a/js/app.js b/js/app.js index 2743f75..09c3494 100644 --- a/js/app.js +++ b/js/app.js @@ -29,7 +29,22 @@ $(document).ready(function () { $(this).find('li.image-placeholder').parent('ul').addClass('no-image-subul'); $(this).find('li.image-placeholder').remove(); } + //console.log('ul = ' + menuImg); //console.log('menu-id = ' + menuNum); }); + var width = $(window).width(); + if(width < 1024){ + $(".stickyContainer").removeClass("sticky"); + + } + // set values based on screen resizing + $(window).resize(function (){ + if( $(this).width() < 1024){ + $(".stickyContainer").removeClass("sticky"); + + } else if($(this).width() >= 1024) { + $(".stickyContainer").addClass("sticky"); + } + }); }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 29d8f11..f5e628a 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -20,7 +20,22 @@ $(document).ready(function () { $(this).find('li.image-placeholder').parent('ul').addClass('no-image-subul'); $(this).find('li.image-placeholder').remove(); } + //console.log('ul = ' + menuImg); //console.log('menu-id = ' + menuNum); }); + var width = $(window).width(); + if(width < 1024){ + $(".stickyContainer").removeClass("sticky"); + + } + // set values based on screen resizing + $(window).resize(function (){ + if( $(this).width() < 1024){ + $(".stickyContainer").removeClass("sticky"); + + } else if($(this).width() >= 1024) { + $(".stickyContainer").addClass("sticky"); + } + }); }); diff --git a/parts/top-bar.php b/parts/top-bar.php index f585e10..726e65a 100644 --- a/parts/top-bar.php +++ b/parts/top-bar.php @@ -5,7 +5,7 @@ - +