Просмотр исходного кода

Clone when dragging from the palette

master
Chris Smith 12 лет назад
Родитель
Сommit
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">

Загрузка…
Отмена
Сохранить