<script> <br>$(function(){ <br>$.easing.def="easeInQuad";//Set the default effect<br>var callback=function (){ <br>alert("ok"); <br>} <br>$("#t1") .animate({ <br>"top":600 <br>},{duration: 3000, <br>easing:"easeInQuad",//can be omitted<br>complete: callback}) <br>}) <br></script>
After using easing, the original method of JQ will not be available. Use an object to replace the time in JQ. The object is as follows:
{duration: 3000, easing: "easeInQuad",complete: callback}
The callback function of the original JQ is replaced by complete
If easing is not used, that is, the time parameter is not replaced by the above object, the original function is retained
That is, it can still be used after loading EASING Use
<script> <br>var callback= function (){ <br>alert("ok"); <br>} <br>$("#t1").hide(3000,callback) <br></script>
Specific parameter details:
duration option:
number of milliseconds
complete option:
call after completion
easing option:
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
ease OutBack
easeInOutBack
easeInBounce
easeOutBounce
easeInOutBounce
Official website
http://gsgd.co.uk/sandbox/jquery/easing/