Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1378438
  • 博文数量: 264
  • 博客积分: 5810
  • 博客等级: 大校
  • 技术积分: 3528
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 17:15
文章分类

全部博文(264)

文章存档

2011年(264)

分类: 系统运维

2011-06-12 07:00:51

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
  2. <html xmlns="">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>无标题文档</title>
  6. <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
  7. <script type="text/javascript">
  8. /**
  9.  *动态的给左边的下拉列表创建选项
  10.  *具体情况可以从数据库读取数据动态创建选项
  11.  */
  12. $(document).ready(function(){
  13.     for(var i=1;i<=5;i++)
  14.     {
  15.        $("#fb_list").append("+i+""); 
  16.     }
  17. })
  18. $(function(){
  19.   $("#add").click(function(){
  20.        if($("#fb_list option:selected").length>0)
  21.        {
  22.            $("#fb_list option:selected").each(function(){
  23.               $("#select_list").append("+$(this).text()+");
  24.               $(this).remove(); 
  25.            })
  26.        }
  27.        else
  28.        {
  29.            alert("请选择要添加的分包!");
  30.        }
  31.    })
  32. })
  33. $(function(){
  34.       $("#delete").click(function(){
  35.            if($("#select_list option:selected").length>0)
  36.            {
  37.                $("#select_list option:selected").each(function(){
  38.                      $("#fb_list").append("+$(this).text()+");
  39.                      $(this).remove(); 
  40.                })
  41.            }
  42.            else
  43.            {
  44.                alert("请选择要删除的分包!");
  45.            }
  46.      })
  47. })


  48. </script>

  49. </head>

  50. <body>
  51. <table width="95%" cellpadding="0" align="center" class="listshow" border="1" cellspacing="0">
  52. <tr>
  53.   <td colspan="4" align="center">选择分包</td>
  54.   </tr>
  55. <tr>
  56.  <td class="black" width="30%" align="center">
  57.        

  58. <select id="fb_list" multiple="multiple" style=" text-align:center;width:300px;height:150px;">
  59.       </select>
  60.  
  61.     </td>
  62.     <td align="center" width="5%">
  63.     <input type="button" id="add" value="添加>>" />
  64.       <br/>
  65.       <br/>
  66.       <input type="button" id="delete" value="<<删除" />
  67.     </td>
  68.     <td class="black" width="30%" align="center">
  69.     <select id="select_list" multiple="multiple" style=" text-align:center;width:300px;height:150px;">
  70.       </select>
  71.     </td>
  72. </tr>
  73. </table>
  74. </body>
  75. </html>


原文链接:
应用场景:编辑主机与快照文件的关联的时候可以应用!
阅读(1444) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~