I am looking to implement a drag and drop function where I can move elements from one div to another, each containing different images. However, I want the image displayed in the second div to change based on the element being dragged.
For example: When dragging #element1 into the images's div, I want to display the image with .element1 class and hide the image with .element2 class.
<div id="element1"></div>
<div id="element2"></div>
<div id="images">
<img class="element1" src="1.jpg" />
<img class="element2" src="2.jpg" />
</div>
Is this possible? I came across a method using jQuery for changing background images but I need it for actual img tags.
I tried implementing it here: http://jsfiddle.net/wolfovs/ab0566Lt/1/
If anyone can help me out, I would greatly appreciate it! Thank you!