I read this about interaction media which is explain how css can detect if pointer is touchscreen or not. It's using @media
query like
@media (pointer: coarse){
body{
// do something
}
}
but I just wonder how to implementing it using javascript ot JQuery, is it possible?
Thank you
I read this about interaction media which is explain how css can detect if pointer is touchscreen or not. It's using @media
query like
@media (pointer: coarse){
body{
// do something
}
}
but I just wonder how to implementing it using javascript ot JQuery, is it possible?
Thank you
Share Improve this question edited Apr 25, 2024 at 13:20 Lucky asked Feb 8, 2017 at 4:29 LuckyLucky 2,0824 gold badges24 silver badges40 bronze badges1 Answer
Reset to default 22is_fine = matchMedia('(pointer:fine)').matches
is_coarse = matchMedia('(pointer:coarse)').matches
Works in Chrome for me.