我想动画的绝对定位元素的位置,但animate()
持续时间参数只适用于一些 CSS规则,而不是其他人。对于width
,height
,top
和left
动画发生在fast
,无论我使用什么值的持续时间。JQuery的动画()持续时间只适用于一些CSS规则
// add the post to the grid
var p = $('.post-bucket .post:nth-of-type(1)').clone();
p.appendTo('.grid');
// animate it
p.animate(
{
width: '200px',
'padding-top': '200px',
opacity: 1.0,3
top: '20px',
},
1200,
function() {}
);
如果我将持续时间更改为5000,不透明度会在5秒内正确更改,但其他更改会在大约200秒内生成动画。
任何想法?