Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 :-)

    #990102

    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

    #990306
    This reply has been marked as private.
    #990351

    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

    #990383
    This reply has been marked as private.
    #990384

    Hi,

    Remove the “/* */” from around the code.

    Best regards,
    Jordan Shannon

    #990386

    Wooow thanks you very much !!!! I’m so happy :)

    #990389

    Hi,

    No problem at all my friend. Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #990392

    For this topic is ok and we will close.
    If a have another question I start another topics ?

    #990401

    Hi,

    Yes, just simply begin a new thread. I will close this one out.

    Best regards,
    Jordan Shannon

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Change logo in sticky header’ is closed to new replies.