问题:单机一个TextBox,要在其下面显示出一个100*200的div,而且这个div浮在所有的元素之上
应该怎么实现

解决方案 »

  1.   


    <HTML>
     <HEAD>
     </HEAD> <BODY>
      <input type="text" onclick="if(document.getElementById('div1').style.display=='block') {document.getElementById('div1').style.display='none';} else {document.getElementById('div1').style.display='block';}"/>
      <div id="div1" style="width:100px; height:100px; background-color:yellow;z-index:0; display:none;"></div>
     </BODY>
    </HTML>
      

  2.   

    问题:单机一个TextBox,要在其下面显示出一个100*200的div,而且这个div浮在所有的元素之上
    ,然后点击div中某个元素,把这个元素的值赋给textbox
    应该怎样实现?
      

  3.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <input type="text" id="txtShow" onclick="if(document.getElementById('div1').style.display=='block') {document.getElementById('div1').style.display='none';} else {document.getElementById('div1').style.display='block';}"/>
        <div id="div1" style="width:100px; height:200px; background-color:yellow;z-index:0; display:none;">
            <label id="lblValue" onclick="document.getElementById('div1').style.display='none';document.getElementById('txtShow').value=this.innerText;">显示值</label>
        </div>
        </div>
        </form>
    </body>
    </html>
    这个已经经过测试了, 绝对达到你的要的效果了。
      

  4.   

    上面那个没有浮在其他元素上,下面这个浮了<div>
        <input type="text" id="txtShow" onclick="if(document.getElementById('div1').style.display=='block') {document.getElementById('div1').style.display='none';} else {document.getElementById('div1').style.display='block';}"/>
        <div id="div1" style="width:100px; height:200px; background-color:yellow;z-index:0; display:none;position:fixed;">
            <label id="lblValue" onclick="document.getElementById('div1').style.display='none';document.getElementById('txtShow').value=this.innerText;">显示值</label>
        </div>
        <br />
        asdkfhaksdhf
        <br />
        
        asdfjaskd
        </div>
      

  5.   

    z-index设置最大 就浮动在在上面 取值的话用jquery或者js
      

  6.   

    jquery插件大多可以解决,给你个网址http://www.open-open.com/ajax/jQuery.htm 自己找吧
      

  7.   


    我一般用模态窗口实现!具体见你发的另一个帖子:http://topic.csdn.net/u/20101019/11/94450083-154d-45f8-accb-b402999b2d49.html?89287