From the course: CSS: Scrolling and Parallax

Unlock this course with a free trial

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

Pinning elements

Pinning elements

- [Instructor] Pinning allows objects to remain in place for a period of time and then released again. So you use the setPin() method and pass along the element that you want to control. And you can pass along a few options. Now one of the options is called pushFollowers. This is normally set to true, but it can be set to false. And that's because pinning and elemental create a gap in the content, the size of the duration, which may not be what you want. Of course, the scene duration property is going to control how long the pin is going to hold for. If you don't specify a duration, the pin is never going to be released unless you're going to scroll back past the trigger position. So let's take a look at how this works. First of all, we can just add a pin right here. And we need to specify the element that we want to pin. So we can go ahead and choose the element with the ID of friend. That's what we've…

Contents