• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Drap and drop speichern

Hahaha

Mitglied
Ich möchte gerne, dass man das gezogene drap and drop speichern kann.

Wie geht das? Hier ist mein code.

<html lang="de"><head>
<meta charset="utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<style>
.draggable { width: 100px; height: 100px; padding:5px; float: left; margin: 5px; background-color:#FE2E2E; display:inline-block; cursor:pointer;}
.droppable { width: 400px; height: 400px; padding:5px; float: left; margin: 10px; background:#2EFE2E; }
</style>
<script>
$(function() {
$('.draggable').draggable({
cursor: "pointer",
revert: "invalid",
opacity: 0.7,
snap: ".droppable",
snapMode: "inner"
});
$( ".droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.find( "p" )
.html( "Dropped!" );
}
});

});

</script>
</head>
<body>
<div class="droppable">
<p>Drop here</p>
</div>
<div class="droppable">
<p>Drop here</p>
</div>

<div class="draggable">
<p>Drag me to my target</p>
</div>
<div class="draggable">
<p>Drag me to my target</p>
</div>
<div class="draggable">
<p>Drag me to my target</p>
</div>
<div class="draggable">
<p>Drag me to my target</p>
</div>
<div class="draggable">
<p>Drag me to my target</p>
</div>

</body>
</html>
 
Werbung:
Sag' mal, geht's noch? Dein Thread wurde aus gutem Grund gelöscht, das heißt aber nicht, dass du sofort wieder einen neuen Thread aufmachen sollst!!! :( Kopfschüttel :(
 
Werbung:
Zurück
Oben