From the course: CSS: Scrolling and Parallax

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Toggling classes

Toggling classes

- [Teacher] Let's take a look at how to do things with ScrollMagic. Now first, the controller is where your animation sequences are going to go. This is the main container for everything you do with ScrollMagic. You can optionally pass an object to your controller to set it up. Now once you have a controller, you can add different scenes, and that will determine how your animations are going to be set up. It's not going to be the animations themselves, but it's going to be where you set up the different animations that you're going to build. The most important thing that you can set up in a scene is the trigger element. This is going to determine the DOM element on your page that is going to trigger this scene. After you set up the scene, you can then chain a number of different actions to your scenes. So for example, you can toggle a class on or off when a certain element is triggered. Or you can pin an element…

Contents