使动画变慢(jQuery)
我正在尝试通过更改块的位置来制作块的动画。
就像,通过 css left
的动画将块从左侧移动到中间。
问题是,动画过程从开始到结束以相同的速度发生。
我想让动画在最后放慢速度,当到达终点时它应该放慢速度。
我该怎么做?我读过有关缓动插件的内容,但不知道应该使用哪种效果,这是想要的效果。
I'm trying to make animation of the block by changing its position
.
Like, move the block from the left to the middle by animation of the css left
.
The problem is, animation process happens with the same speed from the beginning to the end.
I want to make animation slower at the end, it should slow down when it comes to the finish point.
How can I do this? I've read about easing plugin, but don't know which effect should I use, which is the wanted one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您想要缓出效果。以下是一些演示:
http://jquery-ui .googlecode.com/svn/tags/1.6rc6/demos/effects_easings/default.html
编辑:
这是一个更“官方”的演示页面:
http://jqueryui.com/demos/effect/easing.html
You want an ease-out effect. Here are some demos:
http://jquery-ui.googlecode.com/svn/tags/1.6rc6/demos/effects_easings/default.html
EDIT:
Here's a more "official" demo page:
http://jqueryui.com/demos/effect/easing.html
这是一个关于缓动效果表现的很棒的参考:http ://hosted.zeh.com.br/tweener/docs/en-us/misc/transitions.html。是的,我知道这是针对动作脚本库
Tweener
但所有缓动名称都是相同的(大部分)。您正在寻找
easeOut
或easeOutQuad
或easeOutCubic
。 (它们按照开始减速的速度排列)This is an awesome reference for have the easing effects behave: http://hosted.zeh.com.br/tweener/docs/en-us/misc/transitions.html. Yes I know this is for the actionscript library
Tweener
but all of the easing names are the same(For the most part).You're looking for
easeOut
oreaseOutQuad
oreaseOutCubic
. (They are in order of how quickly they will start slowing down)尝试这样的事情:
Try somthing like this: