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

Julian McNeill
Julian McNeill
9,445 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,242 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,445 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,445 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