[Solved] Help!!! | SoloLearn: Learn to code for FREE!

+24

[Solved] Help!!!

Hover 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 Answer

+16

use touchstart,touchmove,touchend-events for getting coordinates x=e.touches[0].clientX; y=e.touches[0].clientY; https://code.sololearn.com/W8jwJqyt4K2y/?ref=app

+7

visph Thank you so much😁

+4

I will do second too Harsh [Studies 📚]

+4

Harsh [Studies 📚] for both devices Use touchstart touchmove touchend mousedown mousemove mouseup

+4

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🤔🤔🤔

+3

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 ;))

+3

Yes I'm original author, btw ok thanks😁

+3

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

+3

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)

+3

You have used only mouse events they are not supported in touch devices so use touch events also :)

+3

Thank you Muskan 😁

+2

visph but where I must write it and how?

+2

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)

+2

visph I mean I must write same with touch(e.touch.clientX)?

+2

Harsh [Studies 📚] tnx😁😆

+2

Wow Thank you so much ŚĄŃ 😄

+2

Sofi welcome

+2

ŚĄŃ but it will work only in touch devices

+2

+2

Yes i know ŚĄŃ