当我进入CART页面时,我正在使用此代码更新购物车-
jQuery('div.woocommerce').on('change keyup mouseup','input.qty',function(){ // keyup and mouseup for Firefox support
if (timeout != undefined) clearTimeout(timeout); //cancel previously scheduled event
if (jQuery(this).val() == '') return; //qty empty,instead of removing item from cart,do nothing
timeout = setTimeout(function() {
jQuery('[name="update_cart"]').trigger('click');
},1000 );
});
我也有与商店页面中相同的增加减少按钮,并尝试使用此代码执行相同的操作
jQuery('li.product').on('change keyup mouseup',1000 );
});
但是它不起作用,如何解决呢?