I have the following javascript code:
$(window).scroll(function() {
if($(this).scrollTop() > 50) /*height in pixels when the navbar becomes non opaque*/
{
$('.navbar-default').addClass('sticky');
$('.navbar-brand img').attr('src','assets/images/logo.png'); //change src
} else {
$('.navbar-default').removeClass('sticky');
$('.navbar-brand img').attr('src','assets/images/logo__footer.png')
}
});
Is it possible to insert a wp custom php code
<?php the_custom_logo(); ?>
Instead of this static attribute
.attr('src','assets/images/logo.png');
Many thanks in advance.
.jsfile that you link in to the page