Can someone plz help I am trying to drop an image onto another image so that the image i drop hides the image i dropped it on | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone plz help I am trying to drop an image onto another image so that the image i drop hides the image i dropped it on

Its for a project im working on and its working how i want it to except its working the complete opposite. Im trying to drop an image onto another and i need the image i dropped to hide the image i dropped it on.

3rd Sep 2017, 8:48 PM
_emilio
1 Answer
+ 2
Post your code (or a link to) if you want accurate answer ^^ If you are using drag'n'drop API from Html5 ( you can also handle it from scratch by yourself, all the more than drag'n'drop feature on mobile devices isn't supported and should require a polyfill -- take a look here: https://code.sololearn.com/Wrhkbc5ngt7y/?ref=app ), I guess the image to be hidden is a valid 'drop zone', with a function attached to the 'ondrop' event/attribute: you must just replace the 'src' value of the image to be hidden/replaced with the image dragged and dropped to avoid use of positionned elements (wich are any 'position' value different from 'static'... ie: it works also for 'relative' value, not only 'absolute' and or 'fixed' ;P)...
4th Sep 2017, 6:33 AM
visph
visph - avatar