hdw.js 998 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. $(document).ready(function(){
  2. //右移
  3. $("#selectclear #right").click(function(){
  4. $("#select1 option:selected").appendTo("#select2");
  5. });
  6. //左移
  7. $("#selectclear #left").click(function(){
  8. $("#select2 option:selected").appendTo("#select1");
  9. });
  10. //上移下移
  11. $("#selectclear #up,#selectclear #down").click(function() {
  12. var $opt = $("#select2 option:selected:first");
  13. if (!$opt.length){
  14. return;
  15. }
  16. if (this.id == "up"){
  17. $opt.prev().before($opt);
  18. }else{
  19. $opt.next().after($opt);
  20. }
  21. });
  22. //双击右移
  23. $("#selectclear #select1").dblclick(function(){
  24. $("#selectclear #select1 option:selected").appendTo("#select2");
  25. });
  26. //双击左移
  27. $("#selectclear #select2").dblclick(function(){
  28. $("#selectclear #select2 option:selected").appendTo("#select1");
  29. });
  30. //$("#add_all").click(function(){
  31. // $("#select1 option").appendTo("#select2");
  32. //});
  33. //$("#remove_all").click(function(){
  34. // $("#select2 option").appendTo("#select1");
  35. //});
  36. });