Jump to content

znx

Member
  • Posts

    2
  • Joined

  • Last visited

Reputation Activity

  1. Like
    znx reacted to tuanphan in Version 7.0 - Shrink logo on scroll   
    Hi. Your template doesn't have "shrink" class name when scrolling. You need to use JS code to add this class.
    Add this to Settings > Advanced > Code Injection > Footer
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(function(){ var visibleTop = 30; $(window).scroll(function() { var scroll = getCurrentScroll(); if ( scroll >= visibleTop ) { $('header#header').addClass('header-sticky'); } else { $('header#header').removeClass('header-sticky'); } }); function getCurrentScroll() { return window.pageYOffset || document.documentElement.scrollTop; } }); </script> <style> header#header img { transition: all 0.3s; } header#header.header-sticky img { max-height: 50px; transition: all 0.3s; } </style>  
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.