(首先实在抱歉最近由于工作原因 好长时间没有写东西,导致网站也没有怎么更新,抱歉)
下面我们来看看用jquery写一个左右选择框,这个还是比较实用的
第一步
我们建立两个下拉框 和一个左移按钮 一个右移按钮 建立后效果图如下
| 以下为引用的内容: <table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF"> <tr> <td height="25" align="center" bgcolor="#F6F6F6">人员选择---<font color="#FF0000"> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF"> <tr> <td height="25" align="center" bgcolor="#F6F6F6">未选人员</td> </tr> <tr> <td> <select name='s1' id="s1" size='18' style='width:130px;height:220;' multiple="multiple"> <option value='a1' >a1</option> <option value='a2'>a2</option> </select> </td> </tr> </table></td> <td valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><input type="button" name="add" id="add" value=">>" class="btn" /></td> </tr> <tr> <td align="center"> </td> </tr> <tr> <td align="center"><input type="button" name="remove" id="remove" value="<<" class="btn" /></td> </tr> </table></td> <td><table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF"> <tr> <td height="25" align="center" bgcolor="#F6F6F6">已选人员</td> </tr> <tr> <td><select name="s2" size="10" multiple="multiple" id="s2" style='width:130px;height:220;' > </select></td> </tr> </table></td> </tr> </table></td> </tr> </table> |
第二步 我们开始写js代码了 (时间问题 代码没有经过优化只是 直接写下去的)
|
以下为引用的内容: $("#s1").dblclick(function(){ $("#s2").dblclick(function(){ $("#add").click(function(){ $("#remove").click(function(){
|
全部代码
|
以下为引用的内容: $("#s1").dblclick(function(){ $("#s2").dblclick(function(){ $("#add").click(function(){ $("#remove").click(function(){
|


