25 Answers
New AnswerHover effect working on computer, but in phone no, I want make draw app, but hover effect doesn't working. Can someone help me? Thanks https://code.sololearn.com/Wb4E49UBURp1/?ref=app
2/18/2021 3:19:58 PM
Sofi {DM Closed❌🚫}25 Answers
New Answeruse touchstart,touchmove,touchend-events for getting coordinates x=e.touches[0].clientX; y=e.touches[0].clientY; https://code.sololearn.com/W8jwJqyt4K2y/?ref=app
Harsh [Studies 📚] for both devices Use touchstart touchmove touchend mousedown mousemove mouseup
Sofi hover effect uses pointer to just add effects not to draw so you can use js as others said I know I am late 📑so I dont know what you did in the code please forgive if I gave wrong information🤔🤔🤔
you should use touch/pointer events in addition to mouse events to fully handle touch devices (touch is default mapped to click, and some other are defined, but complete implementation should be yours ;))
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events/Using_Pointer_Events
https://christianliebel.com/2015/05/enabling-cross-platform-touch-interactions-pointer-vs-touch-events/ at least to see the touch/pointer similarities (and browsers support -- may not reflect actual support)
You have used only mouse events they are not supported in touch devices so use touch events also :)
are you the original author of this code? if so, you need to write it as you write your mouse events handler, with some asjustements (touch events could hold multi-points, while mouse hold only one point)
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message