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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.