Salve.
Guardate un po' qui:
Se io trascino un div "products" nel div "shopping-cart" funziona perfettamente... solo che poi non riesco più a toglierlo da lì dentro!codice:<!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=utf-8" /> <title>Untitled Document</title> <script src="scripts/prototype.js" type="text/javascript"></script> <script src="scripts/scriptaculous.js" type="text/javascript"></script> <script type="text/javascript"> window.onload = function() { new Draggable('prod1'); new Draggable('prod2'); new Draggable('prod3'); Droppables.add('shopping_cart', { accept: 'products', onDrop: function(element) { $('shopping_cart_text').update('Dropped the ' + element.id + ' on me.'); } }); } </script> </head> <body> <div class="products" id="prod1" alt="prodotto 1" style="background:red; width:50px; height:50px;"></div> <div class="products" id="prod2" alt="prodotto 2" style="background:yellow; width:50px; height:50px;"></div> <div class="products" id="prod3" alt="prodotto 3" style="background:green; width:50px; height:50px;"></div> </p> <div id="shopping_cart" style="border:1px solid #f864a3; width:450px; height:100px;"></div> <div id="shopping_cart_text"></div> </body> </html>
C'è un modo per mantenere la trascinabilità degli elementi una volta che sono stati droppati nel contenitore? in due parole... come li levo di lì dentro?
Grazie

Rispondi quotando