Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery动画:以平滑的步骤从右向左反弹_Jquery_Jquery Animate - Fatal编程技术网

jQuery动画:以平滑的步骤从右向左反弹

jQuery动画:以平滑的步骤从右向左反弹,jquery,jquery-animate,Jquery,Jquery Animate,我正在尝试反弹一个元素,并以平滑的步调从右向左移动它 下面是我尝试过的,但我不能得到一个很好的平滑效果。如果我从jQuery中删除right:'+=5px',它的动画效果会更平滑,但仍然不是我想要的 我还想在球停止设置动画后显示带有文本的div。我想不出来 $(文档).ready(函数(){ $(“.ball wrapper”).queue(函数(){ $(this.animate({top:'+=150px'},{duration:500,queue:true}); $(this.anima

我正在尝试反弹一个元素,并以平滑的步调从右向左移动它

下面是我尝试过的,但我不能得到一个很好的平滑效果。如果我从jQuery中删除
right:'+=5px'
,它的动画效果会更平滑,但仍然不是我想要的

我还想在球停止设置动画后显示带有文本的div。我想不出来

$(文档).ready(函数(){
$(“.ball wrapper”).queue(函数(){
$(this.animate({top:'+=150px'},{duration:500,queue:true});
$(this.animate({top:'0px',right:'+=5px'},{duration:500,queue:true});
$(this.animate({top:'+=120px'},{duration:500,queue:true});
$(this.animate({top:'0px',right:'+=5px'},{duration:500,queue:true});
$(this.animate({top:'+=100px'},{duration:500,queue:true});
$(this.animate({top:'0px',right:'+=5px'},{duration:500,queue:true});
$(this.animate({top:'+=50px'},{duration:500,queue:true});
$(this.animate({right:'+=600px'},{duration:3500,queue:false});
$.dequeue(这个);
});
$(“.ball wrapper.text”).css('display','block');
});
.ball包装器{
背景色:红色;
宽度:100px;
高度:100px;
浮动:对;
边界半径:100px;
位置:相对位置;
}
.ball wrapper.text{
显示:无;
位置:相对位置;
}

文本文本。。。
查看本文:

在中,我添加了新代码:

$('#ball').animate({
        left: '100px'
    },
    {        
        duration: 3500, 
        queue: false,
        easing:'linear',
        complete:function(){
          $('#ball').stop(true);
            $('#text').show();
        }
  });
也许这会有帮助