Home > Web Front-end > JS Tutorial > body text

jquery plug-in easing dynamic menu_jquery

WBOY
Release: 2016-05-16 18:20:52
Original
1213 people have browsed it

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

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, after EASING is loaded, it can still be used as follows
Copy code The code is 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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template