Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Iannish Posooa
PLUS
Iannish Posooa
Courses Plus Student 2,392 Points

Is there any way in CSS that I can control an animation by using scroll?

Basically I want to have an animation play while the person scrolls down my page.

  1. This includes animations that are triggered when they reach a certain anchor/div.

  2. An animation timeline that can be scrubbed back and forth by scrolling up or down on my page

1 Answer

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,240 Points

I'm pretty sure you're going to need to use JavaScript to accomplish that. Having ananimation trigger by scrolling requires knowing an elements coordinates on the page, so you'll either need to roll your own JavaScript/jQuery or find a library/plugin that can do it for you.

Iannish Posooa
Iannish Posooa
Courses Plus Student 2,392 Points

Thanks Ryan,

Do you have any resources or treehouse courses that you would recommend. I am currently on the front end track and about to start JQuery basics.

Thanks,