Grow your CSS skills. Land your dream job.

Jquery Smooth scroll with extra animation help please please

  • # May 19, 2012 at 8:28 pm

    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

    # May 21, 2012 at 3:33 am

    Put easing after duration:

    $('a[href^="#"]').click(function() {
    $('html,body').animate({
    scrollTop: $(this.hash).offset().top
    }, 200, "swing");
    return false;
    });
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".