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

Julian McNeill
Julian McNeill
9,444 Points

Need some help!!! with Horizontal anchor smooth scroll

I'm having trouble with the nav it's not scrolling to the right sections. this what i have so far. the website is 4340vk.com

      $('#vk-nav li a').bind('click',function(event){
        var $anchor = $(this);

        $('#page-container').animate({
                        scrollLeft: $($anchor.attr('#von-karman')).offset().left
        }, 1000, 'easeInOutExpo');
        event.preventDefault();

       });

2 Answers

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

Hi Julian,

I went to the website, but there's just a placeholder page with no nav menu or anchor links. Can you give us a little more detailed description of what is happening and what you are trying to accomplish?

Julian McNeill
Julian McNeill
9,444 Points

I'm trying to have the menu links smooth scroll to the section with the specific id that is in the menu links a href="". Does this make more sense?

Julian McNeill
Julian McNeill
9,444 Points

hmmm the page should be live now 4340vk.com. I'm trying to have the menu links smooth scroll to the id that is in each href