$(document).click(function(e){
var obj = $('#div1'); // 设置目标区域
if(!obj.is(e.target) && obj.has(e.target).length === 0){
obj.hide();
}
});
$(document).click(function(e){
var obj = $('#div1'); // 设置目标区域
if(!obj.is(e.target) && obj.has(e.target).length === 0){
obj.hide();
}
});