<!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>demo</title> <mce:script src="jquery.js" mce_src="jquery.js"></mce:script> <mce:script type="text/javascript"><!-- $(function(){ $("#s1 option:first,#s2 option:first").attr("selected",true); $("#s1").dblclick(function(){ $("option:selected",this).clone().appendTo("#s2"); $("option:selected",this).remove(); $("#s1 option:first,#s2 option:first").attr("selected",true); }); $("#s2").dblclick(function(){ $("option:selected",this).clone().appendTo("#s1"); $("option:selected",this).remove(); $("#s1 option:first,#s2 option:first").attr("selected",true); }); $("#add").click(function(){ $("#s1 option:selected").clone().appendTo("#s2"); $("#s1 option:selected").remove(); $("#s1 option:first,#s2 option:first").attr("selected",true); }); $("#remove").click(function(){ $("#s2 option:selected").clone().appendTo("#s1"); $("#s2 option:selected").remove(); $("#s1 option:first,#s2 option:first").attr("selected",true); }); $("#addall").click(function(){ $("#s1 option").clone().appendTo("#s2"); $("#s1 option").remove(); $("#s1 option:first,#s2 option:first").attr("selected",true); }); $("#removeall").click(function(){ $("#s2 option").clone().appendTo("#s1"); $("#s2 option").remove(); $("#s1 option:first,#s2 option:first").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()); } } }); }); // --></mce: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;" mce_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;" mce_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> </body> </html>
来自:http://www.cnjquery.com/html/JQueryshili/200807/03-8.html
相关推荐
jQuery插件---mcdropdow.(仿下拉框多层次)jQuery插件---mcdropdow.(仿下拉框多层次)jQuery插件---mcdropdow.(仿下拉框多层次)jQuery插件---mcdropdow.(仿下拉框多层次)jQuery插件---mcdropdow.(仿下拉框多层次)
jquery插件jquery-ui-1.8.18.custom.min.js
jquery插件--表格分页。
jquery插件jquery-ui-1.8.2.custom.min.js
jQuery插件--星级打分,供大家一起共同分享学习。
Jquery插件-分享插件
Jquery插件-手机端选择省市
Jquery插件-弹窗
jquery插件- slick轮播图插件
jQuery-Waterwheel-Carousel-图片左右滚动切换特效
360°产品展示jQuery插件--3dEye.js
Jquery插件-垂直进度条。。
一个JQuery插件 - Javascript可拖动的模式窗口
jquery插件大全--打包下载 jquery插件大全--打包下载 jquery插件大全--打包下载 jquery插件大全--打包下载
JQUERY插件,ajax不需要刷新,即可实现搜索功能
jquery插件-添加不包邮城市 $(function () { //------生成地区 GetRegionPlug(); //------选择后确定按钮 $(".btntest1").click(function () { var areas = GetChecked().join(",");//已选择的城市名 $("#...
jQuery版本迁移辅助插件,如果您使用的低版本jQuery改为高版本后出现错误,可以试试这个插件。用来检测和恢复在jQuery1.9版本中已删除或已过时的API。jquery-migrate-1.2.1.js,jquery-migrate-1.2.1.min.js
jquery插件-表单验证 根据focus blur
jquery插件-图片轮显,类似苹果浏览器的效果
jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)jquery-3.7.0.min.js(jQuery下载)...