+ 1

Help me in this code....

Actully this is an Desktop application, so it won't work on phone So help me get it work on mobile, I am having difficulties on getting it to work on mobile... So any help is appretiated.... https://code.sololearn.com/WKu8QhAtFMH7/?ref=app https://code.sololearn.com/WKu8QhAtFMH7/?ref=app

2nd Apr 2020, 2:29 PM
DeWill
DeWill - avatar
4 Respostas
+ 6
You have programmed this for MouseEvent's Now use TouchEvent's. Adding handlers for 'touch' , 'touchstart' ,'touchmove' events will be enough. Remember that device can be multitouch so TouchEvent interface provides access to all those Touches through a TouchList In your Touchevent handling function you'll do something like this : function handler(e){ let x = e.touches[0].clientX; } More information here. https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent You can also refer my code : https://code.sololearn.com/WE8V2ng00M1F/?ref=app
2nd Apr 2020, 2:36 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 3
What exactly are the difficulties you're having? What have you tried so far to solve them? In which part of your code are the difficulties lying? Keep in mind that it's hard enough to debug your own code. Much more so, if you have to first understand, then find problems in a code, you did not even write. Help the potential answerer of your question as much as you possibly can!
2nd Apr 2020, 2:33 PM
HonFu
HonFu - avatar
+ 2
Thanks a lot 🇮🇳Omkar🕉 your code make it easy to understand touch event easily..... 😊
4th Apr 2020, 11:22 AM
DeWill
DeWill - avatar
+ 1
And HonFu I will this in mind, while asking questions next time..... Sorry for trouble.....😅
4th Apr 2020, 11:23 AM
DeWill
DeWill - avatar