1234567891011121314151617181920212223242526272829303132333435363738 |
- $(document).ready(function(){
- //右移
- $("#selectclear #right").click(function(){
- $("#select1 option:selected").appendTo("#select2");
- });
- //左移
- $("#selectclear #left").click(function(){
- $("#select2 option:selected").appendTo("#select1");
- });
- //上移下移
- $("#selectclear #up,#selectclear #down").click(function() {
- var $opt = $("#select2 option:selected:first");
- if (!$opt.length){
- return;
- }
- if (this.id == "up"){
- $opt.prev().before($opt);
- }else{
- $opt.next().after($opt);
- }
- });
-
- //双击右移
- $("#selectclear #select1").dblclick(function(){
- $("#selectclear #select1 option:selected").appendTo("#select2");
- });
- //双击左移
- $("#selectclear #select2").dblclick(function(){
- $("#selectclear #select2 option:selected").appendTo("#select1");
- });
- //$("#add_all").click(function(){
- // $("#select1 option").appendTo("#select2");
- //});
-
- //$("#remove_all").click(function(){
- // $("#select2 option").appendTo("#select1");
- //});
- });
|