How to drag an object??
dragging an object in mobile phones, please give codes.
@Tim Thurma answer use JQuery: if you want use drag and drop with vanilla JS, you need to at least use a polyfill to support drag and drop events on touch devices (html5 drag and drop API natively only support mouse events)... this code show how to, and provide references links: https://code.sololearn.com/Wrhkbc5ngt7y/?ref=app
You can find some codes on Code Playground. I found someones and made it a bit more simple so it's easier to understand. https://code.sololearn.com/WNCMz6T2v2ch/?ref=app
@Andrew can you please show a code including this, because I just can't do it right😅
Yes I said you can add onclick event and then added audio player code for example of how you can make audio playing when an object is clicked.
thanks @Tim, but now, how can we add a music to it when we drag it, means when we touch the object to drag, then it will play a song and when released song will also stop, how to do that??
thanks @Tim @Andrew
@tim you shared a code of audio player but I asked for an object which can be dragged and when touched play song, when released stops the song
ok ty @Tim