Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Jquery Smooth scroll with extra animation help please please

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38146
    uddinnyc94
    Member

    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

    #103176
    Taufik Nurrohman
    Participant

    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)
  • The forum ‘CSS’ is closed to new topics and replies.