zoukankan      html  css  js  c++  java
  • 仿Discuz文本框弹出层的效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>文本框弹出内容框并取值</title>
    <Script language="javascript" type="text/javascript">
    function moveselect(obj,target,all){
     if (!all) all=0
     if (obj!="[object]") obj=eval("document.all."+obj)
     target=eval("document.all."+target)
     if (all==0)
     {
       while (obj.selectedIndex>-1){
       mot=obj.options[obj.selectedIndex].text
       mov=obj.options[obj.selectedIndex].value
       obj.remove(obj.selectedIndex)
       var newoption=document.createElement("OPTION");
       newoption.text=mot
       newoption.value=mov
       target.add(newoption)
       }
     }
     else
     {
      for (i=0;i<obj.length;i++)
       {
       mot=obj.options[i].text
       mov=obj.options[i].value
       var newoption=document.createElement("OPTION");
       newoption.text=mot
       newoption.value=mov
       target.add(newoption)
       }
    obj.options.length=0
     }
    }
    function dakai(){
    document.getElementById('light').style.display='block';
    document.getElementById('fade').style.display='block'
    }
    function guanbi(){
    var yuanGong=document.getElementById("yuanGong")
    yuanGong.value=""//如果不加这句,则每次选择的结果追加
    var huoQu=document.getElementById("D2")
    for(var k=0;k<huoQu.length;k++)
    yuanGong.value=yuanGong.value + huoQu.options[k].value + " "//这里的" "中间为空格,为字符间的分隔符,你可以改成别的
    document.getElementById('light').style.display='none';
    document.getElementById('fade').style.display='none'  
    }
    </script>
    <style>
    .black_overlay{display: none;position: absolute;top: 0%;left: 0%; 100%;height: 100%;background-color:#FFFFFF;z-index:1001;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);}
    .white_content {display: none;position: absolute;top: 25%;left: 25%; 50%;height: 50%;padding: 16px;border: 16px solid orange; margin:-32px;  background-color: white;z-index:1002;overflow: auto;}
    </style>
    </head>
    <body>
    <input type="text" id="yuanGong" onclick="dakai()" size="50">
    <div id="light" class="white_content">
    <table border="1" width="350" id="table4" bordercolor="#CCCCCC" bordercolordark="#CCCCCC" bordercolorlight="#FFFFFF" cellpadding="3" cellspacing="0">
          <tr>
            <td width="150" height="200" align="center" valign="middle">
            	该部门员工
              <select size="12" name="D1" ondblclick="moveselect(this,'D2')" multiple="multiple" style="140px">
                <option value="员工1">员工1</option>
                <option value="员工2">员工2</option>
                <option value="员工3">员工3</option>
              </select>
            </td>
            <td width="50" height="200" align="center" valign="middle">
            <input type="button" value="<<" name="B3" onclick="moveselect('D2','D1',1)" /><br />
            <input type="button" value="<" name="B5" onclick="moveselect('D2','D1')" /><br />
            <input type="button" value=">" name="B6" onclick="moveselect('D1','D2')" /><br />
            <input type="button" value=">>" name="B4" onclick="moveselect('D1','D2',1)" /><br />
            </td>
            <td width="150" height="200" align="center" valign="middle">
            未划分部门员工
              <select size="12" name="D2" id="D2" ondblclick="moveselect(this,'D1')" multiple="multiple" style="140px">
                <option value="员工4">员工4</option>
                <option value="员工5">员工5</option>
              </select>
            </td>
          </tr>
    </table>
    <a href = "javascript:void(0)" onclick = "guanbi()">确定</a><BR><BR>
    </div>
    <div id="fade" class="black_overlay"></div>
    </body>
    </html>
    


    欢迎加入JAVA技术交流QQ群:179945282

    欢迎加入ASP.NET(C#)交流QQ群:17534377


  • 相关阅读:
    selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
    ERROR: virtualenvwrapper could not find virtualenv in your path
    VM中的Centos 7配置静态IP
    CentOS7 安装JumpServer
    ERROR 1130 (HY000): Host 'test177' is not allowed to connect to this MySQL server
    获取到一张表中指定字段重复的数量
    Windows7设置局域网文件共享
    vmware虚拟机安装Windows 7后虚拟机自动挂起
    关于PHP版本比较函数version_compare的问题
    关于数据表中一对多、多对一关系的设计
  • 原文地址:https://www.cnblogs.com/q149072205/p/2088753.html
Copyright © 2011-2022 走看看