$(btn_sub).unbind("click");//这里需要 解除 绑定如果不解除 重复绑定 可能会有问题。
//初始化每一个商品的 选中 和非选中 的点击事件。
function init_click_select(){
var itemList = $(".item");
console.log(itemList.length);
for(var i=0;i<itemList.length;i++){
var img = $(itemList[i]).find(".img");
$(img).unbind("click");//这里需要 解除 绑定,如果不解除,会有错误 。 点击没有反应。
$(img).click(function(){
//console.log(this);
var item = $(this).parent();
var select = $(item).attr("select");
console.log(select);
if(select==0){
$(this).find("img").attr("src","/image/wap/shopping/selected.png");
$(item).attr("select",1);
}else{
$(this).find("img").attr("src","/image/wap/shopping/select.png");
$(item).attr("select",0);
}
//判断 全选的状态是否正确。 以及检测数量和合计
check_heji_select();
});
}
}站长微信:xiaomao0055
站长QQ:14496453