Advertisement
jovanovski

ИА Лаб7 Зад3

Dec 6th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.53 KB | None | 0 0
  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
  4. <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  5. <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
  6. <style>
  7.     #sortable1, #sortable2 {
  8.     position:relative;
  9.     list-style-type: none;
  10.     margin: 0;
  11.     padding: 0;
  12.     }
  13.    
  14.     .deck li {
  15.     cursor: pointer;
  16.     position:absolute;
  17.     top:0;
  18.     left:0;
  19.     margin: 3px;
  20.     padding: 0.4em;
  21.     font-size: 1.4em;
  22.     height: 50px;
  23.     width: 50px;
  24.     border: 1px black solid;
  25.     float: left;
  26.     background: white;
  27.     }
  28.    
  29.     #sortable2 li {
  30.     cursor: pointer;
  31.     margin: 3px;
  32.     padding: 0.4em;
  33.     font-size: 1.4em;
  34.     height: 50px;
  35.     width: 50px;
  36.     border: 1px black solid;
  37.     float: left;
  38.     background: white;
  39.     }
  40.    
  41.  
  42.  
  43. </style>
  44. <script>
  45.     $(function() {
  46.         $( "#sortable1, #sortable2" ).sortable({
  47.             connectWith: ".connectedSortable"
  48.         }).disableSelection();
  49.        
  50.         $("#sortable1, #sortable2").sortable().bind('sortstop', function() {
  51.             $("#sortable1 li").css('position', 'absolute');
  52.             $("#sortable2 li").css('position', 'relative');
  53.         });
  54.     });
  55.    
  56.  
  57. </script>
  58. </head>
  59.  
  60. <body>
  61. <ul id="sortable1" style="height:75px;" class="connectedSortable deck">
  62. <li>karta1</li>
  63. <li>karta2</li>
  64. <li>karta3</li>
  65. <li>karta4</li>
  66. <li>karta5</li>
  67. <li>karta6</li>
  68. <li>karta7</li>
  69. </ul>
  70. <br style="clear:both" />
  71. <ul id="sortable2" style="width:600px; height:75px;border:2px red solid;" class="connectedSortable">
  72. <li>karta8</li>
  73.  
  74. </ul>
  75. </body>
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement