jquery select 上移下移
来源:互联网 发布:linux历史命令存放在哪 编辑:程序博客网 时间:2024/04/29 15:53
网上搜到的,不太明白这个插件指的是什么。
但是把代码拷到文件中,修改。确实可以实现上移下移。
<!--jQuery插件---MultiSelects(左右选框),支持select下option元素的上移下移源码:--><!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>MultiSelects(左右选框) 完美版</title><script src="http://demo.deeka.cn/limit2checked/jquery-1.2.6.pack.js"></script><script><!--$(function(){ $("#s1 option:first,#s2 option:first").attr("selected",true); $("#s1").dblclick(function(){ var alloptions = $("#s1 option"); var so = $("#s1 option:selected"); so.get(so.length-1).index == alloptions.length-1?so.prev().attr("selected",true):so.next().attr("selected",true); $("#s2").append(so); }); $("#s2").dblclick(function(){ var alloptions = $("#s2 option"); var so = $("#s2 option:selected"); so.get(so.length-1).index == alloptions.length-1?so.prev().attr("selected",true):so.next().attr("selected",true); $("#s1").append(so); }); $("#add").click(function(){ var alloptions = $("#s1 option"); var so = $("#s1 option:selected"); so.get(so.length-1).index == alloptions.length-1?so.prev().attr("selected",true):so.next().attr("selected",true); $("#s2").append(so); }); $("#remove").click(function(){ var alloptions = $("#s2 option"); var so = $("#s2 option:selected"); so.get(so.length-1).index == alloptions.length-1?so.prev().attr("selected",true):so.next().attr("selected",true); $("#s1").append(so); }); $("#addall").click(function(){ $("#s2").append($("#s1 option").attr("selected",true)); }); $("#removeall").click(function(){ $("#s1").append($("#s2 option").attr("selected",true)); }); $("#s1up").click(function(){ var so = $("#s1 option:selected"); if(so.get(0).index!=0){ so.each(function(){ $(this).prev().before($(this)); }); } }); $("#s1down").click(function(){ var alloptions = $("#s1 option"); var so = $("#s1 option:selected"); if(so.get(so.length-1).index!=alloptions.length-1){ for(i=so.length-1;i>=0;i--) { var item = $(so.get(i)); item.insertAfter(item.next()); } } }); $("#s2up").click(function(){ var so = $("#s2 option:selected"); if(so.get(0).index!=0){ so.each(function(){ $(this).prev().before($(this)); }); } }); $("#s2down").click(function(){ var alloptions = $("#s2 option"); var so = $("#s2 option:selected"); if(so.get(so.length-1).index!=alloptions.length-1){ for(i=so.length-1;i>=0;i--) { var item = $(so.get(i)); item.insertAfter(item.next()); } } });});--></script></head><body><table width="288" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="29"> <input type="button" name="s1up" id="s1up" value="↑" /><br /> <input type="button" name="s1down" id="s1down" value="↓" /></td> <td width="100"><select name="s1" size="10" multiple="multiple" id="s1" style=" width:100px;"> <option value="opt01">option01</option> <option value="opt02">option02</option> <option value="opt03">option03</option> <option value="opt04">option04</option> <option value="opt05">option05</option> <option value="opt06">option06</option> <option value="opt07">option07</option> <option value="opt08">option08</option> <option value="opt09">option09</option> <option value="opt10">option10</option> </select></td> <td width="37" align="center"><input type="button" name="addall" id="addall" value=">|" /><br /><input type="button" name="add" id="add" value=">>" /><br /><input type="button" name="remove" id="remove" value="<<" /><br /><input type="button" name="removeall" id="removeall" value="|<" /></td> <td width="100"><select name="s2" size="10" multiple="multiple" id="s2" style=" width:100px;"> </select></td> <td width="119"> <input type="button" name="s2up" id="s2up" value="↑" /><br /> <input type="button" name="s2down" id="s2down" value="↓" /></td> </tr></table><p>支持直接双击添加/删除,上下(支持间隔)排序</p><p>jQuery Learning 群:24810664</p></body></html>
- jquery select 上移下移
- jquery select 上移下移
- jquery select 上移下移
- jquery 控制 上移 下移
- jquery,js上移下移
- JQUERY JS实现select上移下移自定义排序
- select 上移,下移,置顶,置底
- jquery实现上移下移置顶
- jquery实现节点上移、下移
- 关于js select 上移,下移,置顶,置底
- Select multiple多选上移、下移
- jQuery 实现 li 的上移下移
- jquery 实现列表上移、下移功能
- select 上移下移删除以及模态对话框
- CheckBoxList与SELECT 添加删除 ,置顶,上移,下移,置底
- 用hiAlert插件实现两个select左移右移上移下移等
- select 上移下移删除以及模态对话框
- jquery 动态控制表格,添加,删除,上移,下移,排序
- ExtJS4 Grid组件
- Java byte[] long 转换
- Extjs4 TreePanel实例
- Extjs4 TreeGrid
- 关于并行优化
- jquery select 上移下移
- Extjs 文件上传的实现方法
- super
- 努力学习 努力奋斗 踏步而立
- AS3 Signals之入门篇
- JMS学习笔记7
- Druid--高性能数据库组件
- Oracle 10g Auto Trace安装及SP2-0618和_SP2-0611错误处理
- Extjs4 新的布局方式