|
|
@@ -64,8 +64,16 @@ function init() {
|
|
|
card.style.transform = 'translate(-50%, -50%)'; // 居中
|
|
|
} else {
|
|
|
// 復原到正常狀態的樣式
|
|
|
- card.style.position = 'absolute';
|
|
|
- card.style.zIndex = '2';
|
|
|
+ card.style.position = '';
|
|
|
+ card.style.zIndex = '';
|
|
|
+ card.style.left = '';
|
|
|
+ card.style.top = '';
|
|
|
+ card.style.transform = '';
|
|
|
+ card.classList.remove('popped-out');
|
|
|
+ const cardholder = document.querySelector('.cardholder');
|
|
|
+ cardholder.appendChild(card); // 將卡片移動到容器的最後
|
|
|
+ pckry.appended(card); // 通知 Packery 新增了卡片並重新佈局
|
|
|
+ pckry.layout();
|
|
|
}
|
|
|
}
|
|
|
|