Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
- <script>
- $(function() {
- // get an array of all the unique ids of favorites
- var favorites = new Array();
- $('#favorites > .build').each(function() {
- favorites[favorites.length] = $(this).attr('id');
- });
- console.log(favorites);
- // make favorites sortable
- $('#favorites').sortable().disableSelection();
- // make builds draggable
- $('#builds .build').draggable({
- connectToSortable: '#favorites',
- helper: 'clone',
- revert: 'invalid'
- });
- });
- </script>
- </head>
- <body>
- <div id="favorites">
- <h2>Favorites</h2>
- <div id="ZerglingRush" class="build">
- <a href="#">Zergling Rush</a>
- </div>
- <div id="MassSCVs" class="build">
- <a href="#">Mass SCVs</a>
- </div>
- </div>
- <div id="builds">
- <h2>Builds</h2>
- <div id="FastExpansion" class="build">
- <a href="#">Fast Expansion</a>
- </div>
- <div id="MassHydralisks" class="build">
- <a href="#">Mass Hydralisks</a>
- </div>
- <div id="ZerglingRush" class="build">
- <a href="#">Zergling Rush</a>
- </div>
- <div id="MassSCVs" class="build">
- <a href="#">Mass SCVs</a>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment