jquery Draggable plugin

Lightweight Draggable() jQuery plugin

A  simple lightweight jQuery plugin that adds cross-browser dragging support.

(jquery draggable plugin)

Supports Axis restriction, Parent Boundary restriction.

Demonstration: http://jsfiddle.net/yelton/2TQgB/

Download on Github: https://github.com/scazzy/jQuery-Draggable

If your application requires dragging of elements, creating scrollbars, or anything that can make your app look sexy sticky and dragging, here’s the thing for you.

Unlike Jquery UI’s draggable plugin, that is heavy for your application, (and that requires you to download the pre-requisites to use just the dragging functionality, this one is lightweight (just 1.1Kb minified).

In order to use the plugin, simply bind the “draggable” event to an element.

Here is an example:

<br /><br />// Basic dragging a div<br />$("div").draggable();<br />
&lt;/pre&gt;<br />// Restricting dragging to an axis<br />$("div").draggable({<br /><%%KEEPWHITESPACE%%>  axis: 'x'<br />});<br />
&lt;/pre&gt;<br />// Restricting dragging to it's parent container (boundary)<br />$("div").draggable({<br /><%%KEEPWHITESPACE%%>  containParent: true<br />});<br />
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s