Jump to content

Logo disappearing into the distance

Recommended Posts

Posted

I don't really know what I have done here, when you start scrolling on the site the logo shoots off into he distance for some reason, I would like it to stay still with the rest of the navigation bar.

I used to have some code so the navigation bar and logo followed with the scrolling but I have removed that but for some reason that zoom thing is stll there. Can anyone help?

 

https://www.motivationssmedjan.se/

password: lomma

 

Thanks!

  • Replies 2
  • Views 249
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Try remove this code from Code Injection > Header

<script>
 $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Header-inner').css('padding-top', '1px').css('padding-bottom', '1px').css('transition', '0.3s');
   } else {
     $('.Header-inner').css('padding-top', '').css('padding-bottom', '').css('transition', '0.3s');
   }
 });
  $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Header-branding-logo').css('width', '50px').css('transition', '0.3s');
   } else {
     $('.Header-branding-logo').css('width', '').css('transition', '0.3s');
   }
 });
      $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Index').css('padding-top', '60px').css('transition', '0.3s');
   } else {
     $('.Index').css('padding-top', '').css('transition', '0.3s');
   }
 });
 </script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted

 

Doh 🤯
Thanks Tuanphan, I was looking and looking but forgot about that...

On 11/6/2022 at 4:09 AM, tuanphan said:

Try remove this code from Code Injection > Header

<script>
 $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Header-inner').css('padding-top', '1px').css('padding-bottom', '1px').css('transition', '0.3s');
   } else {
     $('.Header-inner').css('padding-top', '').css('padding-bottom', '').css('transition', '0.3s');
   }
 });
  $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Header-branding-logo').css('width', '50px').css('transition', '0.3s');
   } else {
     $('.Header-branding-logo').css('width', '').css('transition', '0.3s');
   }
 });
      $(document).on('scroll', function() {
   if ($(document).scrollTop() >= 1) {
     $('.Index').css('padding-top', '60px').css('transition', '0.3s');
   } else {
     $('.Index').css('padding-top', '').css('transition', '0.3s');
   }
 });
 </script>

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.