0

This is the fiddle: http://jsfiddle.net/mitchbregs/KkgkQ/3/ This is the fullscreen fiddle: http://jsfiddle.net/mitchbregs/KkgkQ/3/embedded/result/

I can't get anything to work here. When someone selects something on the left navbar, I want it to scroll to the area necessary. Also, once this is done, I would like to have the jQuery removeClass of the selected on and turn it back into the option.. You could see it if you take a look at the html/css.

I have used all these methods:
Method 1: http://www.mediacollege.com/internet/javascript/page/scroll.html
Method 2: http://blog.freelancer-id.com/2009/03/26/scroll-window-smoothly-in-jquery/
Method 3: How to scroll the window using JQuery $.scrollTo() function

Thank you so much everyone who answers!

Community
  • 1
  • 1
sgerbhctim
  • 3,420
  • 7
  • 38
  • 60

1 Answers1

1

add ID to every "section in page" and bind clicks on menu:

$(document).ready(function(){
    $('.contacts').on('click', function(){ 
        $('html, body').animate({
            scrollTop: $('#scroll_contact').offset().top
        }, 1000);
        $('.list_options_selected').attr('class', 'list_options');
        $(this).children(":first").attr('class', 'list_options_selected');
    })
});​

here is JSFiddle

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107