我写了个<span id="sel" onclick="oLayer.style.display='none'"></span><button style="font-family:Arial;font-size:10px;width:22px;height:18px;margin-top:4px;" onclick="putValue()">Go</button>
<div id="oLayer" style="position:absolute;left:30;top:60;z-index:2;background:green;width:120px;height:70px;display:inline">
<select id="1">
<option value="1">1</option>
<option value="1">2</option>
<option value="1">3</option>
</select>
</div>
问题是点的时候是可以隐藏,但是不能将其恢复.郁闷

解决方案 »

  1.   

    <div style="z-index:10;position:absolute;width:100;height:18;overflow:hidden;" onmouseover="this.style.height=100;" onmouseout="this.style.height=18;">
    <iframe  style="position:absolute;z-index:-1;width:100%;height:100%;top:0;left:0;scrolling:no;" frameborder="0" src="about:blank"></iframe>
    <div style="background-color:#cccccc;">aaaaaaa<br>bbbbbbb<br>ccccccc<br>ccccccc<br>ccccccc<br>ccccccc</div>
    </div>
    <select style="width:200" ><option>test0<option>test1<option>test2<option>test3</select>JK写的能挡住下拉的层
      

  2.   

    基本上在网页有applet, iframe and select这三种object不可以被盖住,所以我们只能在需要时将其它隐藏或显示.在有需要的时候,可以通过判断以上对象的覆盖范围是否在我们的对象覆盖范围之内,如果在将其隐藏.
      

  3.   

    只需要知道一个知识点就可以了1.放进iframe容器里
    2.div设置zindex显示优先于iframe,iframe可覆盖select(所以可生成一个iframe将其的高宽与你生成的div高宽相同即可)