0
div
を別のdiv
にアニメーション化し、それをアニメーション化するdiv
の前に追加したいとします。私はdiv
をアニメーション化するmove_to_inventory
という関数を持っています。それが終わったら、prepend_itemsを起動します。しかし、私はそれを働かせることはできません。私はどこでこれを間違っているのですか?アニメーションの後ろに付ける
function move_to_inventory(spelPlan){
$(spelPlan).children('.box').each(function() {
$(this).one('click', function(){
var inventoryPos = $("#inventory").position();
$(this).animate({
width: ($(this).width()/2),
height: ($(this).height()/2),
left:inventoryPos.left+13,
top:inventoryPos.top+12
}, 1000);
prepend_items();
});
});
}
function prepend_items(){
$(this).prependTo('#inventory');
}
:
へ。ただし、前に付いた項目は消えます。何か提案はありますか? –
ボックスの位置は:絶対;左の値です。それはそれを「消える」ようにしました。ご協力ありがとうございました! –