I'm currently trying to write some js. A gradient is selected in my navigation menu. I want the background to vary in height and from gradient to flat color with an opacity of 0.85 (animated) when I scroll down a certain amount.
here is my js code
$(window).scroll(function(){
if ($(window).scrollTop() >= 600){
$('#navigation').css({height: '92px'});
} else {
$('#navigation').css({height: '142px'});
}
});
here css
#navigation {
height: 142px;
width: 1350px;
position: fixed;
z-index: 2000;
background: -moz-linear-gradient(top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.75)), color-stop(100%,rgba(0,0,0,0)));
background: -webkit-linear-gradient(top, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 100%);
background: -o-linear-gradient(top, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 100%);
background: -ms-linear-gradient(top, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 100%);
background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf000000', endColorstr='#00000000',GradientType=0 );
}
I hope someone can help me