$("div#images_all a:has(img)").click(function() { if($(this).data('added')) return false;
$($(this).html()).appendTo("div#images_select").dblclick( function() { $(this).remove(); } ); $(this).data('added', 1); return false; }); I did not test this code, but it should work. Anyway the idea should be clear On Mar 13, 1:39 am, bart <b...@ivwd.nl> wrote: > Hi all, > > I've built something with which you can click an image in one div and > with the click add it to another. Check an example > on;http://www.vliegendepijl.nl/pages/test/pictest.html > > Adding an image from one div to the other works. But as an additional > feature I'd like to also be able to remove images from the second div, > the removal should occur on doubleclicking an image. I've tried > something myself which doesn't work right now... I guess I figure why > but I'm still not familiar enough with javascript/jQuery to fix it > myself. > > Also any image can be added as many times as you like just by clicking > it, what if I'd want a check on that? So that if the image that is > about to be added already exists in the div it won't be added another > time.. > > Anyone who can help me with this? Thanks :)