【发布时间】:2013-09-23 17:52:55
【问题描述】:
我怎样才能使用 jquery 使一堆卡片从一个地方移动到另一个地方的效果
我试过了,但它不起作用:
$( "#img2 li" ).each(function() {
var el = $(this);
// Make it static
el.css({
visibility: 'hidden', // Hide it so the position change isn't visible
position: 'static'
});
// Get the static position
var end = el.position();
// Turn it back to absolute
el.css({
visibility: 'visible', // Show it
position: 'absolute'
}).animate({ // Animate to the static position
top: end.top,
left: end.left
}, function() { // Make it static
$(this).css('position', 'static');
});
});
【问题讨论】: