例如你想点击蓝色隐藏红色区域
红色区域id=redbox
$(document).bind('click', function(e) {
var e = e || window.event;
var elem = e.target || e.srcElement;
while (elem) {
if (elem.id && elem.id == 'redbox') {
return;
}
elem = elem.parentNode;
}
$('#redbox').hide(300);
});
}```
网友评论