How to add a CSS class to some element?

Hello! I want to execute a js script that should change classes. Can I add a class to some elements? My task is to implement the top panel, as in this example: http://jsfiddle.net/mariusc23/s6mLJ/31/

Hey, you can use the built-in scroll event to do such things. I provided you an example, hope that’s what you’re looking for.
ScrollEvent.zip (115.6 KB)

Thank you for help )