So initially i started by doing $(document).on('click', '.selector, .secondSel', function(){...})
and it usually worked, but now that i added the touchstart
event (trying to fix the times when the click event wasn't triggered) alongside the click event nothing changes on windows phones, it seemes like the event is't even triggered. On android phones works fine, i still have to check on iphones, but i think it's working. Is it something with IE? if so how do i make it work on windows phones aswell?
Asked
Active
Viewed 941 times
1

user3847141
- 253
- 2
- 11
2 Answers
0
For Windows phone and IE browser, Touch API is not supported currently (Just for Edge as experimental feature). IE browser has a similar feature known as Pointer API, wich allow you to wrote something like :
myelement.onpointerdown = function(evt) {};
You have to set a css property to HTML Element on wich you want use pointer API :
-ms-touch-action: none;
If you want the same code between Android and Windows phone, you need a polyfill library like : https://github.com/CamHenlin/TouchPolyfill.

t.ouvre
- 2,856
- 1
- 11
- 17
0
The touchstart
equivalent in Windows Phone 8 and Windows 10 Mobile is mousedown
. Don't ask why but it works.
Use this for cross platform support of touch events:
.on('mousedown touchstart', function(e) {
/* do something */
})

andreszs
- 2,896
- 3
- 26
- 34