習慣沉默2017-06-15 09:23:47
You should look like this
$(document).bind("click",function(e){
//通过e.target判断
}
e.target != "You click on the element that needs to be displayed" then execute hide()
迷茫2017-06-15 09:23:47
$("#a").on("click", function(e){
if($(".class").is(":hidden")){
$(".class").show();
}else{
$(".class").hide();
}
$(document).one("click", function(){
$(".class").hide();
});
e.stopPropagation();
});
$(".class").on("click", function(e){
e.stopPropagation();
});