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

jquery插件之easing 动态菜单_jquery

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

很简单的一个效果插件,但不是经常用,怕忘了,以后在用又要去看文档,所以现在把笔记写下来,方便以后

复制代码 代码如下:

<script> <BR>$(function(){ <BR>$.easing.def="easeInQuad";//设置默认效果 <BR>var callback=function (){ <BR>alert("ok"); <BR>} <BR>$("#t1").animate({ <BR>"top":600 <BR>},{duration: 3000, <BR>easing:"easeInQuad",//可省略 <BR>complete: callback}) <BR>}) <BR></script>

使用了easing后,JQ原来的方法有将不可用,用对象代替JQ中时间,该对象如下例
{duration: 3000,easing:"easeInQuad",complete: callback}
原JQ的回调函数由complete代替
如果不使用easing,即时间参数不为上面对象所代替,保留原有功能
即加载EASING后仍可以如下使用
复制代码 代码如下:

<script> <BR>var callback=function (){ <BR>alert("ok"); <BR>} <BR>$("#t1").hide(3000,callback) <BR></script>

效果页:http://gsgd.co.uk/sandbox/jquery/easing/
具体参数细节:
duration 选项:
毫秒数
complete 选项:
完成后调用
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
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!