js层阻止页面冒泡、弹出层失去焦点就隐藏此层也是解决方案

function alertdiv() { alertWin('邮件高级查找',350,250,msg2) } function jqshow() { doSomething(); $('#mailMenu').show(800) } function closew() { // setTimeout(hid,10000) } function hid() {$('#mailMenu').hide(800)} document.onclick=function() { hid() } function doSomething(){ var e = getEvent(); if (window.event) { e.cancelBubble = true; } else { // e.preventDefault(); e.stopPropagation(); } } function getEvent() // 获取Event对象,同时兼容ie和ff的写法 { if (document.all) return window.event; var func = getEvent.caller; while (func != null) { var arg0 = func.arguments[0]; if (arg0) { if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof(arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) { return arg0; } } func = func.caller; } return null; }

 

 

<div style="position:relative;z-index: 14; width:20px; top: -19px; left: 260px; height: 14px; cursor:pointer" onclick="jqshow()"><input type="button" style="border:0px;BACKGROUND-COLOR: transparent; width:100%;" onblur="hid()" value="▼"> </div>

你可能感兴趣的:(function,object,null,input,button,border)