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.

JavaScript

Abe Layee
Abe Layee
8,378 Points

How do I make my arrow to scroll to the next section on my website?

Hello everyone. How are we all doing today? I need a little bit of a help. I am trying to write a script that allows my arrow on my website to scroll down when you click on it. Here is link to my codepen. http://codepen.io/Layee/pen/oXYXPP My arrow has an id of scrolldown.

geoffrey
geoffrey
28,724 Points

I guess you want it to scroll down to the next section of your webpage and stop there ? (As I suppose It's a one page website).

3 Answers

geoffrey
geoffrey
28,724 Points

Ok, I did it this way, here, hope It's going to help you a little bit. You'll see that, if the last section to go to is reached, if ever you click again on the arrow, It'll go back to the first section.

That might be cool as well to change the appearence of the arrow if the last section is reached, I mean we could orientate this one to the top instead of the bottom.

Abe Layee
Abe Layee
8,378 Points

Yes, that is what I want to achieve.

Abe Layee
Abe Layee
8,378 Points

Thank you very much bro.