sniperscope Posted August 6, 2012 Share Posted August 6, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/266722-drop-and-delete/ Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 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(); Quote Link to comment https://forums.phpfreaks.com/topic/266722-drop-and-delete/#findComment-1367133 Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 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> Quote Link to comment https://forums.phpfreaks.com/topic/266722-drop-and-delete/#findComment-1367141 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.