Jquery Mobile Drag And Drop

My jQuery plugins were created either as experiments or to fulfil some need that I had on a project. I made the plugins available for free on this website - and you can still get them all here now.

I no longer actively support the jQuery plugins for the following reasons...

  • Many of the features can now be achieved without JavaScript using new features of HTML and CSS
  • Some of the features probably shouldn't even have been used, they were just experiments!
  • Not everyone wants to use jQuery - I will create stand alone plugins for the popular stuff that don't enforce any particular framework

Jquery Mobile Drag And DropQuick Links

Visit the jQuery Mobile Drag And Drop project hub, which has a demonstration and download for this plugin on JS Plugins JavaScript Plugin Library.

Mobile Drag And Drop Demonstration.

Description

The jQuery Mobile Drag And Drop project is a plugin for the jQuery JavaScript Framework, which provides a drag and drop interface on desktop browsers with fallback "tap to lift" and "tap to drop" interface on touch-screen mobile devices.

Requirements

CSS

/* Recommended styles */
		
		.drag {
			float: left;
			width: 21%;
			background-color: Green;
			color: White;
			margin: 10px 2%;
			cursor: move;
			text-align: center;
			-moz-border-radius: 1em;
			-webkit-border-radius: 1em;
			border-radius: 1em;
		}
		
		.selected {
			background-color: Yellow;
			color: Black;
		}
		
		.drop {
			background-color: Blue;
			color: White;
			margin: 3px;
			padding: 10px;
			-moz-border-radius: 1em;
			-webkit-border-radius: 1em;
			border-radius: 1em;
		}
		.active {
			background-color: orange;
			cursor: crosshair;
		}

JavaScript

$(".drag").mobiledraganddrop({ targets: ".drop" });

With all options set:

$(".drag").mobiledraganddrop({
    "classmodifier": "mobiledraganddrop",
    "targets": ".drop",
    "status": "",
    "selectedclass": "selected",
    "activeclass": "active"
});

You Are Here: Home » Jquery Plugins » Mobile Drag And Drop