Hi !
It is possible to change the logo in my sticky header ?
I would like to place another version of the logo when my menu shrinks.
Thank you :-)
Hey MCLdesign2010,
Thank you for using Enfold.
This script should help you with that. Just adjust the var src value to the second logo image.
add_action('wp_footer', 'ava_toggle_logo_on_scroll');
function ava_toggle_logo_on_scroll(){
?>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
var src = 'SECOND LOGO IMAGE URL HERE';
var logo = $('.logo a');
var img = logo.find('img');
img.clone().appendTo(logo).addClass('second-logo');
var sec = $('.second-logo');
sec.attr('src', src);
function avia_scroll_change_logo()
{
set_status = function()
{
var st = $(window).scrollTop();
if(st < 100)
{
img.show();
sec.hide();
img.addClass('logo-showing');
}
else if(img.is('.logo-showing'))
{
sec.show();
img.hide();
}
};
$(window).on( 'scroll', function(){ window.requestAnimationFrame( set_status )} );
set_status();
}
avia_scroll_change_logo();
});
})(jQuery);
</script>
<?php
}
Best regards,
Ismael
Hi,
You are receiving that error because that is not css. You need to put the suggested code in the functions.php file.
Best regards,
Jordan Shannon
Hi,
Remove the “/* */” from around the code.
Best regards,
Jordan Shannon
Wooow thanks you very much !!!! I’m so happy :)
Hi,
No problem at all my friend. Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon
For this topic is ok and we will close.
If a have another question I start another topics ?
Hi,
Yes, just simply begin a new thread. I will close this one out.
Best regards,
Jordan Shannon