tifbs
tifbs

Reputation: 35

How to use jquery drag and drop to change background color?

I've looked at various examples and demos of jquery drag and drop. What i want to do is this:

Drag small coloured square images (swatches, if you like - these will probably be bitmap/gif images) and drop them into an empty (white) div. Upon doing this, the div then changes background color to match the small square image that was dragged.

Is this possible to do? Does anyone know a plugin that does this or can point me in the right direction? I guess i need to start with the basic drag and drop, but attach some data with it (like some inline css style?) which when dropped will then be applied to the dropzone?

Update - Here's what i've got so far, see http://jsfiddle.net/Q7rDS/ I want to update the dropzone with the color that is set (inline style) on each box..

Any help on this much appreciated, thank you!

Upvotes: 0

Views: 3702

Answers (1)

sudheshna
sudheshna

Reputation: 1150

This can be acheived by using jQuery UI.

demo : http://jqueryui.com/demos/droppable/

Upvotes: 3

Related Questions