소스 검색

Clone when dragging from the palette

master
Chris Smith 12 년 전
부모
커밋
035aefc120
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11
    1
      index.html

+ 11
- 1
index.html 파일 보기

@@ -15,7 +15,17 @@
15 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 30
   </script>
21 31
   <style type="text/css">

Loading…
취소
저장