AndrewMantarro
11/23/2015 - 5:25 AM

drop down scroll

drop down scroll


<script>
$(document).ready(function(){   
        //Change DIVCLASS to DIV Names
    $('#menu').appendTo('#banner');
});
</script>




<script>
    $(document).ready(function() {
        var $banner = $("#banner"),
            $clone = $banner.before($banner.clone().addClass("clone"));
        
        $(window).on("scroll", function() {
            var fromTop = $(window).scrollTop();
            $("body").toggleClass("down", (fromTop > 250));
        });
    });
  
</script>
/* ---------------------------------- */
/* ------------- BANNER ------------- */
/* ---------------------------------- */
#banner {
  position: relative;
background:#f1f1f1;
}

#banner.clone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    transition: 0.2s transform cubic-bezier(.3,.73,.3,.74);
    z-index: 9999;

}

body.down #banner.clone {
    transform: translateY(0);
}