你得到变量的性能& firefox(非常糟糕)chrome(ok)之间的效果 有时这不会做第一个动画,有时它会卡住。
我的结构是否正确?
$notification.animate({
top: '-=' + ($notification.outerHeight() + 20)
}, 1500, function() {
$(this).delay(2000);
$(this).animate({
top: '+=' + ($notification.outerHeight() + 20)
}, 1500, function() {
});
});
答案 0 :(得分:3)
试试这个
$notification.animate({
top: '-=' + ($notification.outerHeight() + 20)
}, 1500, function() {
$(this).delay(2000).animate({
top: '+=' + ($notification.outerHeight() + 20)
}, 1500, function() {
});
});
答案 1 :(得分:2)
试试这个:
$notification
.animate({
top: '-=' + ($notification.outerHeight() + 20)
}, 1500)
.delay(2000)
.animate({
top: '+=' + ($notification.outerHeight() + 20)
}, 1500);
处小提琴