tinyDraggable

A minimalistic jQuery plugin for making objects draggable.

Download   View on GitHub
Drag me!

Selected Drag Handle

Drag Handle

Excluded Handles

Excluded Element

Overview and Features

Released under the MIT License. Source on Github (changelog). Compatible with jQuery 1.5+ in Firefox, Safari, Chrome, Opera, Internet Explorer 7+. No dependencies except the jQuery library.

This plugin was developed by and for Pixabay.com - an international repository for free Public Domain images. We have implemented this piece of software in production and we share it - in the spirit of Pixabay - freely with others.

Usage

Include the JavaScript file jquery.tiny-draggable.min.js after loading the jQuery library. tinyDraggable accepts settings from an object of key/value pairs, and can be assigned to any absolute positioned element.

$(selector).tinyDraggable({key1: value1, key2: value2});

Settings

PropertyDefaultDescription
handlenulljQuery selector for all elements serving as grab handle.
excludenulljQuery selector for elements that must not trigger the dragging event.

Demo Source Code

$('#item1').tinyDraggable();
$('#item2').tinyDraggable({ handle: '.handle' });
$('#item3').tinyDraggable({ exclude: '.exclude_me, input' });

How this plugin can be used in combination with jQuery Colorbox is explained in detail on this blog post.

Please report any bugs and issues at the GitHub repositiory.

This software is released as Open Source under the MIT License by Simon Steinberger / Pixabay.com.

About Us Blog More Goodies © Pixabay.com / Simon Steinberger / Hans Braxmeier