javascript - How to add specific sound on dragged image -
the idea this:
you hear sound have drag , drop right image box. want use teach daughter animals, , myself, want learn more these features.
i hope can me out. time.
here code:
<html> <head> <style type="text/css"> #div1 {width:200px;height:158px;padding:10px;border:1px solid #aaaaaa;} </style> <script> function allowdrop(ev) { ev.preventdefault(); } function drag(ev) { ev.datatransfer.setdata("text",ev.target.id); } function drop(ev) { ev.preventdefault(); var data=ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } </script> </head> <body> <p>jamila sleep het juiste diertje naar de vierkant</p> <audio???? <div id="div1" ondrop="drop(event)" ondragover="allowdrop(event)"></div> <br> <img id="drag1" src="eend.jpg" draggable="true" ondragstart="drag(event)" width="200" height="158"> <img id="drag2" src="tigr.jpg" draggable="true" ondragstart="drag(event)" width="200" height="158">
yours sincerly,
orhan
Comments
Post a Comment