比如有个div其id为body,实现在div外点击隐藏,div内点击不隐藏,采用jQuery实现如下:
$("#body").click(function(e) {
$(this).show();
e.stopPropagation();
});
$(document).click(function(event) {
$("#body").hide();
});$(document).trigger("click");原文地址:http://blog.csdn.net/fengshizty/article/details/42674707