dragging.js

1.0.0 • Public • Published

Dragging.js

A lightweight jQuery plugin that transforms any HTML block into a darggable block.

Example

See demo!

Or try it on codepen

Quick start

  1. Include jQuery:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  2. Include Dragging.js:

    <script src="dist/jquery.Dragging.min.js"></script>
  3. Call the Dragging.js:

    $('#element').Dragging();
    
    // speed
    $('#element').Dragging({
    	speed: 300
    });
    
    // vertical horizontal
    $('#element').Dragging({
    	vertical: true,
    	horizontal: true
    });
    
    // rotate
    $('#element').Dragging({
    	rotate: false
    });
    
    // all together
    $('#element').Dragging({
    	speed: 300,
    	vertical: true,
    	horizontal: true,
    	rotate: false
    });

Options

  • speed any number (default 300)
  • vertical true or false (default true)
  • horizontal true or false (default true)
  • rotate true or false (default false)

Requires

jQuery v1.6.0+

Credits

jQuery Boilerplate

License

The MIT License (MIT).

Package Sidebar

Install

npm i dragging.js

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • vldvel