Guest User

Untitled

a guest
Feb 11th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
  8. <script>
  9. $(function() {
  10.  
  11. // get an array of all the unique ids of favorites
  12. var favorites = new Array();
  13. $('#favorites > .build').each(function() {
  14. favorites[favorites.length] = $(this).attr('id');
  15. });
  16. console.log(favorites);
  17.  
  18. // make favorites sortable
  19. $('#favorites').sortable().disableSelection();
  20.  
  21. // make builds draggable
  22. $('#builds .build').draggable({
  23. connectToSortable: '#favorites',
  24. helper: 'clone',
  25. revert: 'invalid'
  26. });
  27. });
  28. </script>
  29. </head>
  30.  
  31. <body>
  32.  
  33. <div id="favorites">
  34. <h2>Favorites</h2>
  35. <div id="ZerglingRush" class="build">
  36. <a href="#">Zergling Rush</a>
  37. </div>
  38. <div id="MassSCVs" class="build">
  39. <a href="#">Mass SCVs</a>
  40. </div>
  41. </div>
  42.  
  43. <div id="builds">
  44. <h2>Builds</h2>
  45. <div id="FastExpansion" class="build">
  46. <a href="#">Fast Expansion</a>
  47. </div>
  48. <div id="MassHydralisks" class="build">
  49. <a href="#">Mass Hydralisks</a>
  50. </div>
  51. <div id="ZerglingRush" class="build">
  52. <a href="#">Zergling Rush</a>
  53. </div>
  54. <div id="MassSCVs" class="build">
  55. <a href="#">Mass SCVs</a>
  56. </div>
  57. </div>
  58.  
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment