From 1cd650f0fc2f4d09ab366f35d60f08e459bdea7e Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 3 Aug 2016 16:24:46 -0400 Subject: [PATCH] only adding margin to the ad rotate slider after scrolling which is when the fixed position is added to the sticky header --- css/app.css | 3 +-- js/app.js | 3 +++ js/custom/pageSetup.js | 3 +++ scss/_slideshow.scss | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/css/app.css b/css/app.css index 6929413..8982425 100644 --- a/css/app.css +++ b/css/app.css @@ -6624,8 +6624,7 @@ main { @media only screen and (max-width: 40em) { #slideshow { - height: 270px; - margin-top: 140px; } } + height: 270px; } } #slideshow li { list-style: none; } @media only screen and (min-width:40.063em) and (max-width:64em) { diff --git a/js/app.js b/js/app.js index 143d26e..572921e 100644 --- a/js/app.js +++ b/js/app.js @@ -50,13 +50,16 @@ $(document).ready(function () { this.title = $(this.element).find('img').attr('alt'); } }); + var slideshow = $("#slideshow"); var body = $("body"); var sticky = $(".sticky"); $(window).on("scroll", function () { var scrollTop = $(window).scrollTop(); if(scrollTop > 0){ $(sticky).addClass("fixed"); + $(slideshow).css("margin-top", "140px"); } + // if(scrollTop == 0){ // $(sticky).removeClass("fixed"); // $(body).removeClass("f-topbar-fixed"); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index de49c62..62215c7 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -41,13 +41,16 @@ $(document).ready(function () { this.title = $(this.element).find('img').attr('alt'); } }); + var slideshow = $("#slideshow"); var body = $("body"); var sticky = $(".sticky"); $(window).on("scroll", function () { var scrollTop = $(window).scrollTop(); if(scrollTop > 0){ $(sticky).addClass("fixed"); + $(slideshow).css("margin-top", "140px"); } + // if(scrollTop == 0){ // $(sticky).removeClass("fixed"); // $(body).removeClass("f-topbar-fixed"); diff --git a/scss/_slideshow.scss b/scss/_slideshow.scss index eaacdd3..c445b54 100644 --- a/scss/_slideshow.scss +++ b/scss/_slideshow.scss @@ -1,7 +1,6 @@ #slideshow { @media #{$small-only}{ height: 270px; - margin-top: 140px; } li { list-style: none; -- 2.17.1