0

I make an app with angular (4), material and the mobile app with cordova.

I have some event with swipe (with hammer.js), at this moment i use screen size to know if i'm on touch screen.(xs,sm,md for touch and lg,xl for desktop) But it's not a good practice (because some tablet or notebook have the same screen size).

How do you know if the screen is a touch screen?

JeanJacques
  • 1,754
  • 1
  • 12
  • 25
Dioux
  • 106
  • 6
  • Have you searched SO? – Vega Sep 15 '17 at 11:33
  • why you have to know? support it and it should be working anyway, on the desktop you can swipe with the mouse. as for examples see this http://idangero.us/swiper/ and this wrapper https://github.com/zefoy/ngx-swiper-wrapper – Al-Mothafar Sep 15 '17 at 11:40
  • thx for answer, vega yes i tried the ('ontouchstart' in window) but it seems to not work, @al-mothafar, i know just, in my case, i want to hide a btn when i m on touch screen – Dioux Sep 15 '17 at 11:48
  • 1
    yes i know but this answer could lead you to different ways like https://stackoverflow.com/questions/4817029 – Al-Mothafar Sep 15 '17 at 11:52
  • oh sry my bad, i was on mobile mod (in chrome debugger) when a made my test, i close – Dioux Sep 15 '17 at 11:56

0 Answers0