$(document).bind("click",function(e){
            
if($( e.target ).closest(".game-container").length == 
0){
                
alert(111);
                
$(".game-container").hide();//game-container是弹框的样式名称
            
}else{
                
alert(222);//这里是点击弹框的事件
            
}
        })
jquery点击弹框外层关闭弹框,布布扣,bubuko.com
原文:http://www.cnblogs.com/myphper/p/3766219.html