动画 div 高度 + 20px

Animate div height + 20px

现在我有:

$("#emm").delay(3600).animate({
        top: '0px',
        marginTop: '120px'
    }, 500);

但是我如何得到它:

$("#emm").delay(3600).animate({
        top: '0px',
        marginTop: '(#emm height + 20px')
    }, 500);

基本上我希望 marginTop 为 div (#emm) 高度 + 20px 设置动画。 这可能吗?

谢谢!

你可以这样做:

$("#emm").delay(3600).animate({
    top: '0px',
    marginTop: $('#stroke').height() + 20 + 'px'
}, 500);

请看这个JSFIDDLE