首页 > Web开发 > 详细

jQuery 效果方法总结

时间:2017-01-20 12:28:17      阅读:180      评论:0      收藏:0      [点我收藏+]

技术分享

animate(): 自定义动画;(selector).animate({styles},speed,easing,callback)

    styles:通过变化height、border、padding等去改变,必选

    speed:动画的速度;毫秒数/“slow”/“fast”

        easing:动画的不同点上元素的速度;swing(开头和结束慢,中间快<默认>)/linear(匀速)

    callback:完成动画要执行的函数;

clearQueue:清除队列里的动画(未执行的动画,已执行的动画会被执行完);

delay:延迟动画;eg:(selector).delay(speed).fadeIn();

dequeue:暂时不理解,有点乱;写的话,queue下的函数被执行;不写的话,queue下的函数不执行;

$("#start").click(function(){
        div.animate({height:300},"slow");
        div.animate({width:300},"slow");
        div.queue(function () {
            div.css("background-color","red");  
            div.dequeue();
        });
        div.animate({height:100},"slow");
        div.animate({width:100},"slow");
});
//全部执行
$("#start").click(function(){
        div.animate({height:300},"slow");
        div.animate({width:300},"slow");
        div.queue(function () {
            div.css("background-color","red");  
            //div.dequeue();
        });
        //以下代码不被执行
        div.animate({height:100},"slow");
        div.animate({width:100},"slow");
});     

技术分享

技术分享

 

jQuery 效果方法总结

原文:http://www.cnblogs.com/mina-huojian66/p/6322427.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!