function doesn't work well, removing it and replacing with conditionals to check...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:43:25 +0000 (16:43 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:43:25 +0000 (16:43 -0400)
js/app.js
js/custom/pageSetup.js

index 795976f..44257a3 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -56,30 +56,32 @@ $(document).ready(function () {
     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(); 
+       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).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            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");
+            }
         } 
-        
-//        if(scrollTop == 0){
-//            $(sticky).removeClass("fixed");
-//            $(body).removeClass("f-topbar-fixed");
-//        }
+
     });
     
 });
index cf725c9..d210608 100644 (file)
@@ -47,30 +47,32 @@ $(document).ready(function () {
     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(); 
+       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).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            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");
+            }
         } 
-        
-//        if(scrollTop == 0){
-//            $(sticky).removeClass("fixed");
-//            $(body).removeClass("f-topbar-fixed");
-//        }
+
     });
     
 });