-
AuthorPosts
-
July 25, 2018 at 4:06 pm #989764
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 :-)
July 26, 2018 at 8:27 am #990102Hey 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,
IsmaelJuly 26, 2018 at 4:33 pm #990306This reply has been marked as private.July 26, 2018 at 6:59 pm #990351Hi,
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 ShannonJuly 26, 2018 at 8:12 pm #990383This reply has been marked as private.July 26, 2018 at 8:20 pm #990384Hi,
Remove the “/* */” from around the code.
Best regards,
Jordan ShannonJuly 26, 2018 at 8:23 pm #990386Wooow thanks you very much !!!! I’m so happy :)
July 26, 2018 at 8:25 pm #990389Hi,
No problem at all my friend. Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonJuly 26, 2018 at 8:27 pm #990392For this topic is ok and we will close.
If a have another question I start another topics ?July 26, 2018 at 8:35 pm #990401Hi,
Yes, just simply begin a new thread. I will close this one out.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Change logo in sticky header’ is closed to new replies.
