层可以获得焦点吗??我倒是试了下onclick
<div name=div1 onclick="this.style.display='none'">
<input type=button value="button">
<input>
askdfjalsdkf
</div>
点击层中任何一元素都会使层隐藏

解决方案 »

  1.   

    尝试一下在<body>获得焦点时使层隐藏,看能不能?
    <body onclick="layerID.style.display='none'">
      

  2.   

    div有onblur?建议用onmouseout+containscontains Method--------------------------------------------------------------------------------Checks whether the given element is contained within the object. SyntaxbFound = object.contains(oElement)ParametersoElement Required. Element object that specifies the element to check. Return ValueBoolean. Returns true if the element is contained within the current element, or false otherwise.