Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

How do you change content while staying on the same page?


I'm looking to create a webpage that allows users to browse through different animals.

My plan is to have one page dedicated to exhibiting the animals. The page will be filled with rows of thumbnail images of each animal, that lead to another, more detailed page about that animal.

I'm going to provide categorised links on the same page to different animals, so that the animals change, depending on which link the user clicks. However, I want to create a carousel type feature, that keeps the user on the same page as the content changes.

How would I go about achieving this? I don't want to overcomplicate the process.


1 Answer

Steven Parker
Steven Parker
225,730 Points

This sounds like a good use for JavaScript.

JavaScript is particularly suited to responding to window events (like clicks) and then modifying document content.

You might enjoy the recently revised JavaScript and the DOM course. If you have no prior experience, you might start with JavaScript Basics.