Jump to content

Hide an element on scroll

Recommended Posts

  • Replies 1
  • Views 2.8k
  • Created
  • Last Reply
Posted

I saw you used a scroll based event here, please find and replace it with below

<script>
  $(window).scroll(function(){
  var scroll = $(window).scrollTop();
  if(scroll > 50){
    $('.language').addClass('scrollHidden');
    $('.Header').addClass('scrollNav');
  }
  else{
    $('.language').removeClass('scrollHidden');
    $('.Header').removeClass('scrollNav');
  }
});
</script>

And custom css for it

@media only screen and (max-width: 600px) {
  .language {
    transition: top .5s;
  }
  .language.scrollHidden {
    top: -10px;
  }
}

image.png.1ed53ea9e6cc5a038ed90d06f7d9eb37.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Archived

This topic is now archived and is closed to further replies.

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