Streaming live at 10am (PST)

Remove / add class on scroll


#1

Any idea how to add it in on custom code?


#2

Something like this?

<script>
$(window).scroll(function() {
  $('#myElementId').addClass('scrolled');
});
</script>

#3

Hi @samliew thank you for the answer.
Iv tried the code but its not working.

Iv added a fullpage.js to the site and its mostly ok. Im just trying to add a feature that will make the hero section "Without overflow" that will make the scroll bar invisible, until you scroll down to the next section right under it and then it becomes visible.


#4

You cannot single out a section to selectively remove scrollbars.


#5

I'm not sure if this would work for you (since I've never used fullpage.js before), but reading their documentation under State classes added by fullpage.js, it seems that they add an .active class on the active slide. So what you could potentially do in your CSS is make it so that, for example... #herosection.active { overflow: hidden; }.

You'll have to play around with it a little bit based on what element you're overflow hiding, but it could be something you can look into.


#6

@garyyau @samliew

Iv added a cloneable fullpage.js on this post along with some of the other tricky features that are not working.


#7