Browse Source

Clone when dragging from the palette

master
Chris Smith 12 years ago
parent
commit
035aefc120
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      index.html

+ 11
- 1
index.html View File

15
        .appendTo($('#palette'));
15
        .appendTo($('#palette'));
16
     });
16
     });
17
 
17
 
18
-    $('.tower,.core').draggable();
18
+    $('.tower,.core').draggable({
19
+     helper: 'clone',
20
+     containment: 'window',
21
+     stop: function(evt, ui) {
22
+      $(this).clone()
23
+        .draggable()
24
+        .css('position', 'absolute')
25
+        .offset(ui.helper.offset())
26
+        .appendTo(document.body);
27
+     }
28
+    });
19
    });
29
    });
20
   </script>
30
   </script>
21
   <style type="text/css">
31
   <style type="text/css">

Loading…
Cancel
Save