Wait with applying scrolling class to a sticky header

Hi,

I’m running into a problem whenI want to make the navbar smaller when the person starts scrolling. Like here: https://metliz.zorgeloos-online-staging.nl/

However because the navbar changes in size, the scroll position gets pushed up. This can cause it to remove the .scrolling class again and then it kinda looks buggy. You can test this by manually sliding the scrollbar a tiny bit down. In this use case it is not as noticable, but I have had instances where this was a bigger problem.

  • Is there any way within bricks to add the scrolling class after the user has scrolled for a set amount?
  • Am I thinking about this the wrong way?

I could always add my own class with JS after the user has scrolled x amount of pixels, but I rather keep it within bricks if possible.

1 Like