Hi, I’m trying to change the logo image to another image when user scrolls down the page, but it seems that the .header-scrolled class doesn’t appear in a header with custom pixel value. If I change the header size to predefined, for example slim, it works. Is this a bug or is it supposed to work like that?
Hey teme,
Have you activated the header in Enfold > Header > Header Behaviour ?
If it is still not working for you Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
Vinay
Link and login info are attached to the private content field.
Hi,
I added this code to your child theme’s functions.php:
function add_custom_script(){
?>
<script>
(function($){
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 50) {
$("#header").addClass("header-scrolled");
} else {
$("#header").removeClass("header-scrolled");
}
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Best regards,
Josue