Jump to content

Drop and delete


sniperscope

Recommended Posts

Hi.

I am having some difficult times for 3 days. Searched over net but i couldn't find good tutorial or example.

 

What i want is just drag a div element into Garbage Icon and delete from mysql.

I got one example site http://jsfiddle.net/KWdcU/40/ exactly what i want unfortunately it deletes all element at once. And i have no idea how to populate mysql as well.

 

I will be much appreciate for any help or guide me to a tutorial site.

 

Regards

Link to comment
https://forums.phpfreaks.com/topic/266722-drop-and-delete/
Share on other sites

Hi.

I am having some difficult times for 3 days. Searched over net but i couldn't find good tutorial or example.

 

What i want is just drag a div element into Garbage Icon and delete from mysql.

I got one example site http://jsfiddle.net/KWdcU/40/ exactly what i want unfortunately it deletes all element at once. And i have no idea how to populate mysql as well.

 

I will be much appreciate for any help or guide me to a tutorial site.

 

Regards

 

Why do you remove all box ?

$('.box').remove();

Link to comment
https://forums.phpfreaks.com/topic/266722-drop-and-delete/#findComment-1367133
Share on other sites

Try this:

 

<!DOCTYPE html>
<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">
    .draggable { width: 75px; height: 25px; background: silver; padding: 10px; margin-bottom: 2px; }
    #droppable { position: absolute; left: 250px; top: 0; width: 125px; height: 75px; background: gray; color: white; padding: 10px; }
  </style>
  <script>
  $(document).ready(function() {
    $("div.draggable").draggable();
    $("#droppable").droppable({
      drop: function() { alert('dropped'); }
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="droppable">Drop here</div>

<div class="draggable">Drag me 1</div>
<div class="draggable">Drag me 2</div>
<div class="draggable">Drag me 3</div>
<div class="draggable">Drag me 4</div>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/266722-drop-and-delete/#findComment-1367141
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.