added width variable to help check for window width to apply margin to the top of...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:31:53 +0000 (16:31 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Aug 2016 20:31:53 +0000 (16:31 -0400)
js/app.js
js/custom/pageSetup.js

index 8af87d5..aea09eb 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -50,16 +50,19 @@ $(document).ready(function () {
             this.title = $(this.element).find('img').attr('alt');
         }
     });
+    
     var slideshow = $("#slideshow");
     var body = $("body");
     var sticky = $(".sticky");
+    var width = $(window).width();
+    
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            if(scrollTop > 319 && scrollTop < 641 ){
+            if(width > 319 && width < 641 ){
                 $(slideshow).css("margin-top", "140px");
-            } else if(scrollTop > 639 && scrollTop < 1025){
+            } else if(width > 639 && width < 1025){
 //                $(slideshow).css("margin-top", "140px");
             }
         } 
index 69f4ffe..df41742 100644 (file)
@@ -41,16 +41,19 @@ $(document).ready(function () {
             this.title = $(this.element).find('img').attr('alt');
         }
     });
+    
     var slideshow = $("#slideshow");
     var body = $("body");
     var sticky = $(".sticky");
+    var width = $(window).width();
+    
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
         if(scrollTop > 0){
             $(sticky).addClass("fixed");
-            if(scrollTop > 319 && scrollTop < 641 ){
+            if(width > 319 && width < 641 ){
                 $(slideshow).css("margin-top", "140px");
-            } else if(scrollTop > 639 && scrollTop < 1025){
+            } else if(width > 639 && width < 1025){
 //                $(slideshow).css("margin-top", "140px");
             }
         }