开发者

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!


This can be acheived by using jQuery UI.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜