• Resolved gregstoltz

    (@gregstoltz)


    Hi,
    I am currently using the free version of neve and I am trying to make my sticky header responsive based on the scroll.

    I am having trouble figuring out how to add CSS to make the header logo shrink

    Any help is appreciated!

    Additional CSS

    .header.shrink {
      font-size: 13px;
      position: fixed; 
    	z-index:999999;
      top: 0;
      width: 100%;
      transition: 0.2s;
    }
    
    .site-logo.shrink img{
    	max-width: 45px;
    }

    functions.php

    
    <script>
    jQuery(document).ready(function($) {
        $(window).scroll(function () {
            if ($(window).scrollTop() > 10) { 
                $('header').addClass('shrink');
    	    $('site-logo').addClass('shrink');
            }
            else{
                $('header').removeClass('shrink');
    	    $('site-logo').removeClass('shrink');
            }
        });
    });
    </script>

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Vytis

    (@bvytis)

    Hi @gregstoltz,

    Thank you for posting your questions!

    Your website is on localhost so we can’t access it to check but I see you are placing JavaScript directly to the functions.php file – that’s not gonna work. You would need to JavaScript to some JavaScript file created and then hook that file using functions.php file.

    I hope that helps!

    • This reply was modified 6 years ago by Vytis.
Viewing 1 replies (of 1 total)

The topic ‘Shrink logo on Scroll’ is closed to new replies.