Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Olga__Kondr

show/hide menu when scrolling

Recommended Posts

Hello friends!
I am trying to repeat the effect of disappearance of the menu in scrolling. As it is done here: https://greensock.com/forums/topic/24688-problems-creating-sticky-nav/

I don't want the menu color to be displayed right away, like here:

See the Pen vYLpgGY by linkslegend (@linkslegend) on CodePen


but I can't repeat it :(
Who can tell you how to implement the effect correctly?

See the Pen jOryXay by Ollymolly (@Ollymolly) on CodePen

Link to post
Share on other sites

Hey @Olga__Kondr

 

In your pen you are using LESS/SCSS-Syntax for the CSS, but are not pre-processing it at all.

 

So your

 

  &--scrolled {
    height: 0px;
  }

 

inside of your .header is invalid.

 

I took it out of the .header and put it like this

 

.header--scrolled {
    height: 0px;
}

 

and it works just fine.

 

See the Pen BazVRKK by akapowl (@akapowl) on CodePen

 

 

 

Also note, that I added a transition and an overflow: hidden to your .header in this example.

 

 

  • Like 5
Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×