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! While you're at it, check out some resources Treehouse students have shared here.

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

JavaScript

Help on creating Alphabetical Scrolling Sidebar

I am sort of new in the application development world and as now I have the challenge of creating a Alphabetical Scrolling Sidebar to display the contact according to the clicked letter. I have no clue how to do it and if anyone of you know how to, I would love to get some guidance. I know I can use the Jquery .scrolltop but have no clue how to. I think it is because of my lack of javascript skills. Please help!!!

17 Answers

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hello Milagro Lopez

I've put a small video together to help you out. Hope this helps.

For anyone who's interested in Creating an Alphabetical Scrolling Sidebar with jQuery you can download the project files here and follow along.

Regards
Andrew

James Barnett
James Barnett
39,199 Points

Andrew Chalkley - Over 40 upvotes I think that's a forum record

Rafael Flores
Rafael Flores
Courses Plus Student 22,056 Points

Andrew what about when the content is dynamic? You do not know if you are going to have certain names with a particular letter how does it works then?

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

That's a really open ended question. Anything is possible and there's a number of ways you can do it. Maybe share your code in the forum (as a Workspace Snapshot or Github repository) and collaborate with someone on it. Sounds like a good project for Treehouse students to tackle.

Kevin Korte
Kevin Korte
28,148 Points

I really think this kind of response is an excellent idea. I'm sure it's also quite time consuming, but very valuable.

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

Every Thursday a Treehouse teacher will be posting a video response to an unanswered question in the forum.

Be sure to always include your code in your posts to get the best solution to your problems. :)

This was very helpful. I didn't immediately think to override the default event for the browser. Thank you for the insight. I really like the video responses, but I understand it is time consuming. Thanks again!

Sounds great!

Hayden Evans
Hayden Evans
15,399 Points

Love that you guys are doing this with some questions around the forum! Treehouse just keeps getting better and better constantly!

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

We love you guys too! That's why we do it :)

Andrew, it is exactly what I wanted!

Tom Bedford
Tom Bedford
15,645 Points

Thank you Andrew Chalkley! Will the various videos be compiled over time into a section on the site? It would be a shame if they got lost in the depths of the forum....

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

Yep. Our design and dev team will be looking in to this soon.

Paulo Aguiar
Paulo Aguiar
14,120 Points

The treehouse teachers videos to a forum response weekly is an excellent idea!

Thanks!

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

The video is properly embedded now too :)

This is quite nice!

Wow this is awesome Andrew Chalkley

Tom Bedford
Tom Bedford
15,645 Points

I followed through the example and after completing it I was receiving an error in the console after clicking to scroll up/down a few times:

"Uncaught TypeError: Cannot read property 'top' of undefined"

This initially left me puzzled and looking to see if I had made mistakes. However, it happens when you click "U" as there is no list for "U"!

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

You should add some checking and share the code :)

This is great and exactly what I was looking for. Someone asked me about doing something like this a year ago. Finally glad to have found something.

Great. Thanks!

Jason Hess
Jason Hess
4,789 Points

Andrew, this is such a great idea. You guys rock. I have to agree, Treehouse just keeps getting better anD better. That is the nature of a website though, each release should be more innovative than the last. Thanks to the users input. Keep up the great work guys/ gals.

kevinbroomall
kevinbroomall
6,643 Points

A.C. this is great - would love to see more 1 off tutorials like this one!

This is the best!

haha awesome reply from teacher :D

Joshua Pinter
Joshua Pinter
1,172 Points

Really, really great video. Clear and concise.

TeamTreeHouse for President.

Tiffany McAllister
Tiffany McAllister
25,806 Points

This works really great, thank you. How would you add active states to the navigation to show which letter you are on?