Hello. I am needing a little help tweaking some code to accomplish what I am thisclose to getting done on the site. Overall, I have the header set up so that it is transparent and the slider fits beneath it. On scroll, the header turns solid. Works perfectly. However, on certain pages, for example “portfolio items” I would like to have a solid white background, no scroll, with a blue logo, as opposed to a white logo. Piecing together some code, I was able to get the blue logo on the white background and change the color of the links. However, when I scroll down, it turns back to white.
Here is the code I have so far:
jQuery(function($) {
$(window).scroll(function() {
if ($(window).scrollTop() > 400) {
$(’.x-navbar’).addClass(“x-navbar-solid”);
$(’.x-navbar a’).css(“color”, “#000”);
$(’.x-brand img’).attr(‘src’,‘BLUE-LOGO-URL’);
$(’.mobile’).css(“background-color”, “transparent”);
} else {
$(’.x-navbar’).removeClass(“x-navbar-solid”);
$(’.x-navbar a’).css(“color”, “#fff”);
$(’.x-brand img’).attr(‘src’,‘WHITE-LOGO-URL’);
$(’.mobile’).css(“background-color”, “rgba(0,0,0,0.95)”);
}
});
});
jQuery(".single-x-portfolio .x-brand img").attr(“src”,“BLUE-LOGO-URL”);
jQuery(".single-x-portfolio .x-navbar a").css(“color”, “#909090”);