zoukankan      html  css  js  c++  java
  • ie6实现div在select控件之上

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html> 
            <head> 
                    <script> 
                    function DivSetVisible(state) 
                    { 
                            var DivRef = document.getElementById('PopupDiv'); 
                            var IfrRef = document.getElementById('DivShim'); 
                            if(state) 
                            { 
                                    DivRef.style.display = "block"; 
                                    IfrRef.style.width = DivRef.offsetWidth; 
                                    IfrRef.style.height = DivRef.offsetHeight; 
                                    IfrRef.style.top = DivRef.style.top; 
                                    IfrRef.style.left = DivRef.style.left; 
                                    IfrRef.style.zIndex = DivRef.style.zIndex - 1; 
                                    IfrRef.style.display = "block"; 
                            } 
                            else 
                            { 
                                    DivRef.style.display = "none"; 
                                    IfrRef.style.display = "none"; 
                            } 
                    } 
                    </script> 
            </head> 
            <body> 
                    <form> 
                            <select> 
                            <option>A Select Box is Born ....</option> 
                            </select> 
                    </form> 
                    <div id="PopupDiv" style="position:absolute; top:25px; left:50px; padding:4px; display:none; background-color:#000000; color:#ffffff; z-index:100"> 
                            .... and a DIV can cover it up<br/>through the help of an IFRAME. 
                    </div> 
                    <iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"> 
                    </iframe> 
                    <br/> 
                    <br/> 
                    <a href="#" onclick="DivSetVisible(true)">Click to show DIV.</a> 
                    <br/> 
                    <br/> 
                    <a href="#" onclick="DivSetVisible(false)">Click to hide DIV.</a> 
            </body> 
    </html> 

  • 相关阅读:
    [读书笔记] 树莓派 raspberry pi cluster的搭建实践
    [学姿势了] bmp当中插入javascript code
    [读书笔记] 两则之一: Smarter video searching and indexing 更为智能的视频搜索和索引技术
    [读书笔记] 两则之一: 100Gbps传输
    [无知故学习]范式HUFFMAN coding
    [学习笔记]关于CUDA与OPENCL
    [以资鼓励]用于提醒,未来如果在我这台optimus + gtm540的acer NV47H75C上安pnv驱动
    转: Beautiful Numbers (费马小定理)
    Bear and String Distance (贪心 )
    zoj3946--Highway Project
  • 原文地址:https://www.cnblogs.com/mizzle/p/2130867.html
Copyright © 2011-2022 走看看