Home  >  Article  >  Web Front-end  >  jquery plug-in easing use_jquery

jquery plug-in easing use_jquery

WBOY
WBOYOriginal
2016-05-16 18:21:031119browse
Copy code The code is as follows:

<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
as follows to copy the code The code is as follows:

<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 websitehttp://gsgd.co.uk/sandbox/jquery/easing/
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn