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.

General Discussion

Link to section within page

Hey Guys,

I understand the concept of linking an anchor tag to another section on the same page with the (#example) code, but idk how semantic that is. Is there a better way?

Also, when you click on such anchor tag it just quickly sends you to that place (ID) in the page without a subtle and nice transition. Does anyone know of good open source code to make that transition swiftly??

thank you in advance for your help!

Justin

5 Answers

Like the website http://simplemodal.plasm.it/#home

if you were to click on overview or examples or any of the other nav elements it subtly slides down to that part of the page.

Richard Lewis
Richard Lewis
5,101 Points

you could use jquery to achieve this (scrollTo) as an example, a css transition maybe?

Matt Campbell
Matt Campbell
9,767 Points

It's gotta be jQuery.

You can link the anchor you click on with the JQuery selector and then send it to the area of the site you want to go to with a slide transition set to slow or something.

thanks for the help guys! much appreciated