Eu possuo um script onde eu arrasto a Drag And Drop, e é salvo no MYSQL a posição dela.
Mas ela possue apenas uma div, eu preciso de duas div, onde eu consiga arrastar ambas as div's e é salvo no banco de forma independente.
Como posso fazer ?
Meu código
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Drag</title> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> <script> $(document).ready(function() { $('#icone_1_1').draggable({ stop: function(e, ui) { var x = $(this).css('left').replace('px', ''); var y = $(this).css('top').replace('px', ''); var z = 1; $.ajax({ url: 'arquivo.php', cache: false, data: 'x=' + x + '&y=' + y + '&z=' + z, }); } }); }); </script> </head> <body> <div id="icone_1_1" style="width:300px;height:250px;left:100;top=100;cursor:move;background:#ccc"></div> </body> </html>
Toda ajuda será bem vinda.
Edição feita por: 3dmaniaco, 28/05/2012, 07:57.