我正试图将物品拖到购物篮中。一旦物品掉入篮筐,物品价格将更新为篮筐的总价格。我错过了什么吗?它允许我放入“购物车”,但不会更新总价。如何更新物品掉落时的总价格?
$(".item").draggable({
revert : true
});
$("#i1").draggable();
$("#i2").draggable();
$("#i3").draggable();
$("#cart").droppable({
drop : function (event, ui) {
$(this).find(".price");
total_price = total_price + price;
$("#cprice").html("$ " + total_price);
}
});
我想我们会需要html或其他东西... – elclanrs 2012-02-25 05:09:38