ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
215
215
EMPFEHLEN
-
Hallo,
Ich möchte per Drag & Drop eine "Box" verschieben.
Beim einfachen Drag & Drop klappt das soweit ganz gut.
Sobald ich dann allerdings die abgelegte Box wieder verschiebe und nach unten platziere, wird diese zu weit nach unten abgelegt.
Ich hoffe ich hab mich einigermaßen verständlich ausgedrückt!?
Wo hab ich einen Fehler drin?
Hier der Code:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<html> <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <style type="text/css"> #optionen { width: 80px; height: 200px; border: 1px solid gray; padding: 5px; } .draggable { height: 60px; } .droppable { width: 80px; height: 60px; border: 1px solid gray; padding: 10px; } .bez { margin-left:10px; border: 1px solid gray;} #platz { position:absolute; top:10px; left:150px; } </style> <script> $(document).ready(function() { $(".draggable").draggable({ helper: 'clone', revert : true }); $(".droppable").droppable({ accept: '.draggable', drop: function(event, ui) { var element = $(ui.draggable).clone(); $(this).empty().append(element); ui.helper.remove(); element.draggable(); } }); }); </script> </head> <body style="font-size:62.5%;"> <div id="platz"> <div class="droppable"></div> <br> <div class="droppable"></div> </div> <div id="optionen"> <div class="draggable"> <div class="bez">Test</div> </div> <div class="draggable"> <div class="bez">Test2</div> </div> </div> </body> </html>
Ähnliche Themen
-
Drag n Drop
Von kerstel im Forum Javascript & AjaxAntworten: 4Letzter Beitrag: 21.01.10, 13:36 -
Drag and Drop
Von Busi im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 5Letzter Beitrag: 25.10.07, 15:39 -
SWT: Ghosted Drag-Image bei Drag & Drop
Von snake_plissken im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 1Letzter Beitrag: 15.04.06, 23:36 -
Drag and Drop
Von Reverent im Forum .NET ArchivAntworten: 0Letzter Beitrag: 11.06.04, 17:08 -
Drag & Drop
Von bjmicha im Forum JavaAntworten: 1Letzter Beitrag: 20.02.04, 07:56





Zitieren
Login





