0

My page currently has a header at the top with different links. When the links are clicked, the page automatically scrolls to that part of the page. I'm using this jQuery code for the autoscroll:

$("#about").click(function(e){

      var targetOffset= $("#two").offset().top;
      $('html, body').animate({scrollTop: targetOffset}, 1500);
      e.preventDefault();

});

I'd like to use the jQuery UI bounce effect on the link as well, so that it bounces as the page scrolls. How do I make these effects happen at the same time? And also, how do I link to jQuery UI file within the html document?

Rachel
  • 1
  • check here http://stackoverflow.com/questions/10251109/jquery-animate-with-effect-bounce-after-animation-is-complete – morgan9999 Jul 14 '14 at 05:13

1 Answers1

1

You can set easing like this:

$('html, body').animate({scrollTop: targetOffset}, {duration: 1000, easing: 'easeOutBounce'});

see more about easing here

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231