Jquery 如何为animate()设置持续时间和缓和属性

Jquery 如何为animate()设置持续时间和缓和属性,jquery,Jquery,下面是我的代码。它工作得很好,但我不知道如何增加持续时间和缓解它。我还想添加一个回调函数 $(".pcs").animate({ top:height/2-50, left:width/2-50, width:100, opacity:1, },{step: function(now,fx){ $(".pcs").css('-webkit-transform','rotate(' + now

下面是我的代码。它工作得很好,但我不知道如何增加持续时间和缓解它。我还想添加一个回调函数

    $(".pcs").animate({
        top:height/2-50,
        left:width/2-50,
        width:100,
        opacity:1,
    },{step: function(now,fx){
            $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
        }});
.animate(属性[,持续时间][,缓和][,完成])

所以你可以用

            $(".pcs").animate({
                    top:height/2-50,
                    left:width/2-50,
                    width:100,
                    opacity:1,
                },{step: function(now,fx){
                        $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
                    ,
                    duration: 200,// or any numeric value
                    easing: 'linear' // or any supported easing effect, for more easing effect you can used jquery ui
                    }});
检查放松效果

。设置动画(属性[,持续时间][,放松][,完成])

$(".pcs").animate({
      top:height/2-50,
      left:width/2-50,
      width:100,
      opacity:1,
   }, {
      step:function(now,fx){
         $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
      },
      duration: /*int*/,
      easing: /*string*/,
      complete: /*function when animation is complete*/
   });
所以你可以用

            $(".pcs").animate({
                    top:height/2-50,
                    left:width/2-50,
                    width:100,
                    opacity:1,
                },{step: function(now,fx){
                        $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
                    ,
                    duration: 200,// or any numeric value
                    easing: 'linear' // or any supported easing effect, for more easing effect you can used jquery ui
                    }});
检查放松效果

。设置动画(属性[,持续时间][,放松][,完成])

$(".pcs").animate({
      top:height/2-50,
      left:width/2-50,
      width:100,
      opacity:1,
   }, {
      step:function(now,fx){
         $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
      },
      duration: /*int*/,
      easing: /*string*/,
      complete: /*function when animation is complete*/
   });
所以你可以用

            $(".pcs").animate({
                    top:height/2-50,
                    left:width/2-50,
                    width:100,
                    opacity:1,
                },{step: function(now,fx){
                        $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
                    ,
                    duration: 200,// or any numeric value
                    easing: 'linear' // or any supported easing effect, for more easing effect you can used jquery ui
                    }});
检查放松效果

。设置动画(属性[,持续时间][,放松][,完成])

$(".pcs").animate({
      top:height/2-50,
      left:width/2-50,
      width:100,
      opacity:1,
   }, {
      step:function(now,fx){
         $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
      },
      duration: /*int*/,
      easing: /*string*/,
      complete: /*function when animation is complete*/
   });
所以你可以用

            $(".pcs").animate({
                    top:height/2-50,
                    left:width/2-50,
                    width:100,
                    opacity:1,
                },{step: function(now,fx){
                        $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
                    ,
                    duration: 200,// or any numeric value
                    easing: 'linear' // or any supported easing effect, for more easing effect you can used jquery ui
                    }});

检查放松效果

Jquery动画功能的工作原理如下:

$(".pcs").animate({
      top:height/2-50,
      left:width/2-50,
      width:100,
      opacity:1,
   }, {
      step:function(now,fx){
         $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
      },
      duration: /*int*/,
      easing: /*string*/,
      complete: /*function when animation is complete*/
   });
element.animate( properties, options );
你可以做:

$(".pcs").animate({
    top:height/2-50,
    left:width/2-50,
    width:100,
    opacity:1},{
        duration: 1000,/*A string or number determining how long the animation will run. (1000 = 1 second)*/
        easing: "linear",/*A string indicating which easing function to use for the transition.*/
        step: function(now,fx){
            $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
        },
        complete: function() {
            // Animation complete.
        }
    }
);

要了解更多详细信息,您可以查看Jquery动画功能的工作原理如下:

element.animate( properties, options );
你可以做:

$(".pcs").animate({
    top:height/2-50,
    left:width/2-50,
    width:100,
    opacity:1},{
        duration: 1000,/*A string or number determining how long the animation will run. (1000 = 1 second)*/
        easing: "linear",/*A string indicating which easing function to use for the transition.*/
        step: function(now,fx){
            $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
        },
        complete: function() {
            // Animation complete.
        }
    }
);

要了解更多详细信息,您可以查看Jquery动画功能的工作原理如下:

element.animate( properties, options );
你可以做:

$(".pcs").animate({
    top:height/2-50,
    left:width/2-50,
    width:100,
    opacity:1},{
        duration: 1000,/*A string or number determining how long the animation will run. (1000 = 1 second)*/
        easing: "linear",/*A string indicating which easing function to use for the transition.*/
        step: function(now,fx){
            $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
        },
        complete: function() {
            // Animation complete.
        }
    }
);

要了解更多详细信息,您可以查看Jquery动画功能的工作原理如下:

element.animate( properties, options );
你可以做:

$(".pcs").animate({
    top:height/2-50,
    left:width/2-50,
    width:100,
    opacity:1},{
        duration: 1000,/*A string or number determining how long the animation will run. (1000 = 1 second)*/
        easing: "linear",/*A string indicating which easing function to use for the transition.*/
        step: function(now,fx){
            $(".pcs").css('-webkit-transform','rotate(' + now + 'deg)');
        },
        complete: function() {
            // Animation complete.
        }
    }
);

要了解更多详细信息,请查看

。我不确定您还需要什么其他信息。我尝试了很多方法,但没有通过步骤添加这些属性:。我不确定您还需要什么其他信息。我尝试了很多方法,但没有通过步骤添加这些属性:。我不确定您还需要什么其他信息。我尝试了很多方法,但没有通过步骤添加这些属性:。我不确定您还需要什么其他信息。我尝试了很多方法,但没有通过步骤添加这些属性: