【发布时间】:2014-12-11 11:10:38
【问题描述】:
简单的学习任务......但它不适合我。
任务很简单,我正在尝试以方形布局旋转一个框(路径:go right -> down -> left -> up)....但它在移动后没有动画down(没有't go left or up after it)这是代码:
$('button').click(function () {
$('.box').animate({
"height": "40px",
"width": "40px"
}, 500, function () {
$('.box').animate({
"margin-left": "200px", //go right
}, 1500, function () {
$('.box').animate({
"margin-top": "200px", //go down
}, 1500, function () {
$('.box').animate({ // <===problem starts here
"margin-right": "200px" //go left
//"marginRight": "200px"
}, 1500, function () {
$('.box').animate({
"margin-bottom": "200px" //go up
}, 1500, function () {
$('.box').css("background", "black")
});
});
});
});
});
});
在制作动画时是否有任何适当的方法可以混合margins?请指教...
【问题讨论】:
标签: jquery css jquery-animate margin