html代码
.... //弹出框内具体内容省略
js代码(引入jquery)
$(function () { $("#detailMsg").click(function(e){ e= e || window.event; if(e.cancelBubble) e.cancelBubble = true; else e.stopPropagation(); }); $("body").click(function(){ $('#detailMsg').css("display","none"); }); });