有人能帮我弄一下这段代码吗?我正在制作一段内容的动画,而我的缓动字符串对我来说不能正常工作。有人能快速指出我做错了什么吗?谢谢
// JavaScript Document
$(document).ready(function() {
$('.learnmore').mouseover(function() {
$(this).parent().find('.cover').stop().delay(100).animate({
top: '50px',
duration:400,
easing:'easeOutElastic'
})
});发布于 2011-06-10 04:37:21
您错误地使用了.animate。这两种样式是:
.animate([CSS Properties], [Options (Easing/Duration/Complete)])
或
.animate([CSS Properties], [Duration], [Easing], [Complete]);
http://api.jquery.com/animate/
你想要这个:
$(this).parent().find('.cover').stop().delay(100).animate({
top: '50px'
}, {
duration: 400,
easing: 'easeOutElastic'
});发布于 2011-06-10 04:35:45
jQuery库只有缓动模式swing和linear。您需要包含插件的easing plugin或jQuery UI。
https://stackoverflow.com/questions/6298823
复制相似问题