air
air

Reputation: 6264

jquery drag and drop

I am using jquery for drag-and-drop and it works fine with 2 divs, I can drag an image across 2 divs. One div can be dragged while the other can be dropped upon.

What I want is to have 4 divs, where I have images in each div and I can drag an image from one div to another.

Is this possible in jquery? If yes can you write a little code for me?

Thanks

Upvotes: 1

Views: 2652

Answers (3)

DaMayan
DaMayan

Reputation: 94

You need to use (and include) JQuery UI to use the $('#something').draggable() and $('#something').droppable() functions.

You can make as much items as you want draggable or droppable and create different functions for each one. Its pretty easy to work with.

This is the best example with the most functionality: http://jqueryui.com/demos/droppable/#photo-manager

Upvotes: 0

Irshad Hussain
Irshad Hussain

Reputation:

Please check Jquery Demo from Jquery website or

check this

http://web-design-dubai-uae.blogspot.com/2009/09/jquery-drag-and-drop.html

Upvotes: 3

slf
slf

Reputation: 22777

Check out these jQuery Examples, specifically the Sortables Demo

Upvotes: 0

Related Questions