I am making template with fixed menu on top, all works ok except I cant get background color of header to be changed once page scrolls, to avoid elements under menu to be visible.
I am using something like this but not working, anyone have idea?
jQuery(document).ready(function(){
var scroll_start = 0;
var startchange = $('#startchange');
var offset = startchange.offset();
if (startchange.length){
$(document).scroll(function() {
scroll_start = $(this).scrollTop();
if(scroll_start > offset.top) {
$("#t3-mainnav").css('background-color', '#000000');
} else {
$("#t3-mainnav").css('background-color', 'transparent');
}
});
}
});