treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Jquery Smooth scroll with extra animation help please please

  • okay here is the code please take a close look at it


    $('a[href^="#"]').click(function() {
    $('html,body').animate({scrollTop:$(this.hash).offset().top}, 200);
    return false;
    });


    how can i alter this code so that i can add a easing effect like swing to it please help me
  • Put easing after duration:
    $('a[href^="#"]').click(function() {
    $('html,body').animate({
    scrollTop: $(this.hash).offset().top
    }, 200, "swing");
    return false;
    });