Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and drop without JQuery UI

I searched a lot to find a tutorial for drag & drop with jQuery alone (without UI), but due to the popularity of JQuery UI, all drag and drop features are based on JQuery UI.

Can anyone give me a hint how to make a basic Drag & Drop by JQuery standalone?

like image 813
Googlebot Avatar asked Feb 24 '12 17:02

Googlebot


3 Answers

There are several plugins that you may use take a look at the following

http://wayfarerweb.com/jquery/plugins/animadrag/

http://threedubmedia.com/code/event/drag/demo/

it still jquery but no UI

like image 82
COLD TOLD Avatar answered Oct 05 '22 16:10

COLD TOLD


I think a good starting place might be to map out the process, and then decide which jQuery tools you will need to use for each user action.

so the user process might be:

  • Click on your content div on a "draggable" area
  • Drag the content, which will keep the content inside that div
  • release the mouse, which will put the content into a "droppable" container, which will adjust the size of the previous content to fit the droppable size

which needs the following types of event listeners:

  • mouseup
  • mousedown
  • animate

At the very least. Another option might be to check out the jQuery UI source, and see how they do it! Which will tell you exactly what to do but you can add to it or trim where necessary.

like image 34
Evan Avatar answered Oct 05 '22 18:10

Evan


http://thezillion.wordpress.com/2012/09/27/javascript-draggable-2-no-jquery

See this. It's core JS and easy to implement.

like image 24
thezillion Avatar answered Oct 05 '22 17:10

thezillion