5
我有一個網站我正在研究,有幾個absolutelty定位divs,我需要調整點擊,這些將填補divs在容器中。問題是我怎麼讓他們切換回到原來的位置(頂部,左側),這是不同的。jQuery動畫回到原來的位置
$(".work-item .toggle").toggle(function() {
$(this).parent().animate({ height: '430', width: '930', top: '0', left: '0' }, 750);
},
function() {
var pos = $(this).parent();
var position = pos.position();
$(this).parent().animate({ height: '150', width: '200', top: position.top, left: position.left }, 750);
});
嘗試了上述,但它獲得了新的位置不是原來的。
在此先感謝。
PVS
謝謝尼克!作品一種享受。 – 2010-10-04 11:58:12