I have a CSS say
div.borderYtoX a:before,
div.borderYtoX a:after {
position: absolute;
opacity: 0.5;
height: 100%;
width: 2px;
content: '';
background: #FFF;
transition: all 0.3s;
}
I want to change the background here to some different color when I scroll down. Its affecting the navigation menus on scroll. Below is the jQuery code and also what I tried but its not working. Is there a possible way to do it here?
$(document).ready(function(){
var scroll_start = 0;
var startchange = $('#startchange');
var offset = startchange.offset();
$(document).scroll(function() {
scroll_start = $(this).scrollTop();
if(scroll_start > offset.top) {
$('.header').css('background-color', 'rgb(255,255,255)');
$('div.container a').css('color', '#063193');
$('.borderYtoX a:before, .borderYtoX a:after').css('background', '#063193');
} else {
$('.header').css('background-color', 'rgba(255,255,255,0.3)');
$('div.container a').css('color', '#fff');
$('div.borderYtoX a:before, div.borderYtoX a:after').css('background', '#fff');
}
});
});