Jump to content

delay entry transition on shrink sticky nav mobile logo

Recommended Posts

Hey, i'm looking to set a time delay on the mobile header sticky nav logo.

on the homepage only, i would love it to enter / transition in when you hit the second section of the homepage.

i.e the 'guiding soulful wedding creatives..' bit, once you've scrolled past the big main sticky logo image. 

 

i believe i've got it to do this on desktop, but i need a different time set for mobile, is this possible? i believe its a @tuanphan bit of code i originally used in home settings > advanced > code injection

 

www.moonlitdesign.uk/home-old

Link to comment
  • Replies 5
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

35 minutes ago, tuanphan said:

Can you share code you used for desktop?

it is in the individual home page > advanced > code injection

 

<script>
  $(window).scroll(function(){
  var scroll = $(window).scrollTop();
  if(scroll > 100){
    $('header#header').addClass('scrollNav');
  }
  else{
    $('header#header').removeClass('scrollNav');
  }
    
});
</script>
<style>
  
  
  header#header img {
    opacity: 0;
    transition: all 0.3s;
}
  
  
.scrollNav img {
    opacity: 1 !important;
    transition: all 0.3s;
}
  
  

  
</style>

Link to comment
On 4/16/2024 at 2:47 PM, moonlitdesign said:

it is in the individual home page > advanced > code injection

 

<script>
  $(window).scroll(function(){
  var scroll = $(window).scrollTop();
  if(scroll > 100){
    $('header#header').addClass('scrollNav');
  }
  else{
    $('header#header').removeClass('scrollNav');
  }
    
});
</script>
<style>
  
  
  header#header img {
    opacity: 0;
    transition: all 0.3s;
}
  
  
.scrollNav img {
    opacity: 1 !important;
    transition: all 0.3s;
}
  
  

  
</style>

You mean change transition 0.3s or change number 100 on mobile?

image.thumb.png.bbfbf473f80f65a274cde4a0d6aa50c5.png

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!)

Link to comment

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.