How to use easing in the jQuery plugin jQuery.ScrollTo?

alexchenco picture alexchenco · Jan 17, 2011 · Viewed 27.9k times · Source

The website only mentions the easing option:

# easing: Name of the easing equation.

But there's no example.

How to use this feature?

Answer

David Tang picture David Tang · Jan 17, 2011

The examples are here: http://demos.flesler.com/jquery/scrollTo/

Use like so:

$.scrollTo( '#options-examples', 800, {easing:'easeOutQuad'} );

These easing functions don't come built in though. You can use the jQuery Easing plugin. This then supplies the following easing functions:

  • jswing
  • easeInQuad
  • easeOutQuad
  • easeInOutQuad
  • easeInCubic
  • easeOutCubic
  • easeInOutCubic
  • easeInQuart
  • easeOutQuart
  • easeInOutQuart
  • easeInQuint
  • easeOutQuint
  • easeInOutQuint
  • easeInSine
  • easeOutSine
  • easeInOutSine
  • easeInExpo
  • easeOutExpo
  • easeInOutExpo
  • easeInCirc
  • easeOutCirc
  • easeInOutCirc
  • easeInElastic
  • easeOutElastic
  • easeInOutElastic
  • easeInBack
  • easeOutBack
  • easeInOutBack
  • easeInBounce
  • easeOutBounce
  • easeInOutBounce