testing custom function that checks the small medium and large view width during...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:39:50 +0000 (16:39 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:39:50 +0000 (16:39 -0400)
js/app.js
js/custom/pageSetup.js

index aea09eb..795976f 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -55,16 +55,25 @@ $(document).ready(function () {
     var body = $("body");
     var sticky = $(".sticky");
     var width = $(window).width();
+    var page_front = $(".page-front");
+    function check_window_width(){
+        if(width > 319 && width < 641 ){
+                 $(page_front).css("padding-top", "200px");
+            } else if(width > 639 && width < 1025){
+                $(page_front).css("padding-top", "155px");       
+            } else if(width > 1024){
+                $(page_front).css("padding-top", "20px");
+            }
+    }
     
+    $(window).resize( function () {
+       check_window_width(); 
+    });
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            if(width > 319 && width < 641 ){
-                $(slideshow).css("margin-top", "140px");
-            } else if(width > 639 && width < 1025){
-//                $(slideshow).css("margin-top", "140px");
-            }
+            check_window_width();
         } 
         
 //        if(scrollTop == 0){
index df41742..cf725c9 100644 (file)
@@ -46,16 +46,25 @@ $(document).ready(function () {
     var body = $("body");
     var sticky = $(".sticky");
     var width = $(window).width();
+    var page_front = $(".page-front");
+    function check_window_width(){
+        if(width > 319 && width < 641 ){
+                 $(page_front).css("padding-top", "200px");
+            } else if(width > 639 && width < 1025){
+                $(page_front).css("padding-top", "155px");       
+            } else if(width > 1024){
+                $(page_front).css("padding-top", "20px");
+            }
+    }
     
+    $(window).resize( function () {
+       check_window_width(); 
+    });
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            if(width > 319 && width < 641 ){
-                $(slideshow).css("margin-top", "140px");
-            } else if(width > 639 && width < 1025){
-//                $(slideshow).css("margin-top", "140px");
-            }
+            check_window_width();
         } 
         
 //        if(scrollTop == 0){