Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/02/2010, 09:03
Avatar de jackson666
jackson666
 
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 6 meses
Puntos: 65
Respuesta: Arrastrar y soltar objetos + MySQL

Luego, con la ultima version de mootools podrias hacer algo asi:

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  5.     <meta name="author" content="Jackson666" />
  6.     <title>Mootools FX - Drag and Drop</title>
  7. <script type="text/javascript" src="mootools.js"></script>
  8. <script type="text/javascript">
  9.  window.addEvent('domready', function(){
  10.     var w = 200;
  11.     var h = 150;
  12.     var drag = new Drag.Move('draggable',{
  13.        
  14.         droppables: '#drop',
  15.         onDrop: function(el, droppable){
  16.            
  17.             if(droppable){
  18.                 w += 60;
  19.                 h += 10;
  20.                 droppable.set('morph', {
  21.                                     transition: 'bounce:out',
  22.                                     duration: 1000
  23.                                    });
  24.            
  25.                 droppable.morph({ width : w, height : h });
  26.                 $('draggable').morph({
  27.                                         'top' : 35,
  28.                                         'left' : 40
  29.                                      });
  30.            
  31.                 el.clone().cloneEvents(el).inject(droppable).morph('#draggable');
  32.                 el.setStyles({
  33.                             'margin' : '5px 0 0 30px',
  34.                             'float' : 'left'
  35.                             });
  36.             }
  37.         }
  38.        });
  39.     });
  40. </script>
  41. <style type="text/css">
  42.  #draggable{
  43.     width: 60px;
  44.     height: 50px;
  45.     background-color: black;
  46.     cursor: move;
  47.     position: relative;
  48.     z-index: 9998;
  49.     color: white;
  50.     padding: 10px;
  51. }
  52.  
  53.  #drop{
  54.     width: 650px;
  55.     height: 100px;
  56.     position: absolute;
  57.     top: 35px;
  58.     right: 40px;
  59.     background-color: #7fcfff;
  60.     color: white;
  61.     border: 2px solid #000000;  
  62.  }
  63. </style>
  64. </head>
  65. <body>
  66. <div id="draggable">Drag me!</div>
  67. <div id="drop">
  68. <h3 align="center" style="margin: 0; padding: 0;">Drop here!</h3>
  69. </div>
  70. </body>
  71. </html>
__________________
HV Studio
Diseño y desarrollo web