Hey guys, what's the simplest way to make the red layer sticky as soon as it reaches the top?
Thanks in advance!
Hey Vince, add the code in this image to the bottom of your code.
First, stack your red rectangle on top of the other elements using it's z property. Then, we write a conditional that says "if scroll's scrollY property is above 470, just keep red's y property at the same value."
thanks Chad!! I also included an else, otherwise when scrolling up the y coordinates are different
cc Nathanael - this is a better explanation that the one i was giving a few months back :P