<script> $(function(){ $.easing.def="easeInQuad";//设置默认效果 var callback=function (){ alert("ok"); } $("#t1").animate({ "top":600 },{duration: 3000, easing:"easeInQuad",//可省略 complete: callback}) }) </script>
使用了easing后,JQ原来的方法有将不可用,用对象代替JQ中时间,该对象如下例
{duration: 3000,easing:"easeInQuad",complete: callback}
原JQ的回调函数由complete代替
如果不使用easing,即时间参数不为上面对象所代替,保留原有功能
easing 选项:
jswing
def
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