$(".show_list_price").hover(function () {
$(this).closest("td").find(".amount_prices").show();
}, function () {
$(this).closest("td").find(".amount_prices").hide();
});
鼠標移到單價上,顯示階梯價格:
但對於新插入的行,這個事件就失效了,解決辦法是:
$("body").on("mouseenter", ".show_list_price", function() {
$(this).closest("td").find(".amount_prices").show();
});
$("body").on("mouseleave", ".show_list_price", function() {
$(this).closest("td").find(".amount_prices").hide();
});