Drag & Drop & Download with Mootools

Drag zip icon to download box to donwload the source code


Mootools version which I have adapted from Ryan Scherf's original drag & drop download script using the prototype library

Here is the mootools code:
window.addEvent('domready', function() {
  var dragElement 	= $('drag_me');
  var dropElement 	= $('drop_box');
  var start_position	= $('start_position');	
  var myDrag = new Drag.Move(dragElement, {
    // Drag.Move options
	droppables: dropElement,
	// Drag.Move Events
	onDrop: function(el, dr) {
		if (!dr) { 
		}else {
			dr.highlight('#667C4A'); //flashes green
			//alert("downloading...");
			window.location.href="drag_drop_download.zip";
		};
	},
	onComplete: function(el) {
		new Fx.Move(dragElement, {
  			relativeTo: start_position,
 			position: 'topleft',
 			transition: Fx.Transitions.Elastic.easeOut,
			duration: 1000
		}).start();
	}
  });
});