I've made this header: https://www.youtube.com/watch?v=LOWjWRy_Kks and at the place of the logo, I've inserted a picture, which is black.
When I scroll down, I want this image to be white (since the header turns black), so I've made a white version of the same image.
However I have no idea where to insert the image. I've been thinking about inserting it in the javascript code, which is the following:
$(window).on('scroll', function() {
if($(window).scrollTop()) {
$('nav').addClass('black');
}
else {
$('nav').removeClass('black');
}
})
How can I swap in this white image using javascript?