It’s a very simple effect plug-in, but I don’t use it often. I’m afraid I’ll forget it, and I’ll have to read the documentation when I use it in the future, so I’ll write down the notes now for convenience later
<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, after EASING is loaded, it can still be used as follows
<script> <br>var callback=function (){ <br>alert(" ok"); <br>} <br>$("#t1").hide(3000,callback) <br></script>
Effect page: http://gsgd .co.uk/sandbox/jquery/easing/
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
ease OutQuint
easeInOutQuint
easeInSine
easeOutSine
easeInOutSine
easeInExpo
easeOutExpo
easeInOutExpo
easeInCirc
easeOutCirc
easeInOutCirc
easeInElastic
easeOutElastic
easeInOutElastic
easeInBack
easeOutBack
easeInOutBack
easeInBounce
easeOutBounce
easeInOutBounce