Procházet zdrojové kódy

Clone when dragging from the palette

master
Chris Smith před 12 roky
rodič
revize
035aefc120
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  1. 11
    1
      index.html

+ 11
- 1
index.html Zobrazit soubor

@@ -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">

Načítá se…
Zrušit
Uložit