问题描述:
$(document).on('click', '.ico_code', function(e){
console.log('ico_code-------');
});
$(document).on('click', '.ico_computer', function(e){
console.log('ico_computer-------');
});
$(document).on('tap', '.jd_case', function(e){
console.log('jd_case--------');
});
$(document).on('click', '.ico_code', function(e){
console.log('ico_code-------');
e.stopPropagation();
});
$(document).on('click', '.ico_computer', function(e){
console.log('ico_computer-------');
e.stopPropagation();
});
$(document).on('tap', '.jd_case', function(e){
console.log('jd_case--------');
});
原因:
解决:
$(document).on('click', '.ico_code', function(e){
console.log('ico_code-------');
});
$(document).on('click', '.ico_computer', function(e){
console.log('ico_computer-------');
});
$(document).on('tap', '.jd_case', function(e){
if ($(e.target).hasClass('ico_computer') || $(e.target).hasClass('ico_code')) {
return;
}
console.log('jd_case--------');
});