Create droppable area that can accept random text/images?

I think this May Help you! By giving the same "Class" to all dragable elements you can achieve you goal. Js: $(function() { var $gallery = $('#something'), $trash = $('#divAccept'); $('.

Drop',$gallery). Draggable({ revert: 'invalid', containment: $('#divAccept'). Length?'#divAccept' : 'document', helper: 'clone', cursor: 'move', }); $trash.

Droppable({ accept: '#something > . Drop', drop: function(ev, ui) { deleteImage(ui. Draggable); } }); // image deletion function function deleteImage($item) { $item.

FadeOut(function() { $item. AppendTo($trash).fadeIn(); }); } }); Html: random text JQuery UI is can give you better guidance.

Thanks for the response. The code looks good, except I won't have the luxury of adding the drop class to "random text" and the image. If I can't do that, can there still be a way to have a droppable that can accept it?

Regards, David.

It might be possible to detect mouse events and dynamically make the content draggable ... You can get the selected text using: txt = document.getSelection(); It looks like this only works on text, not the actual HTML though. Full selection code is here: codetoad.com/javascript_get_selected_tex....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions