Skip to content Skip to sidebar Skip to footer

Javascript Detect Desktop Touch And Mouse Support

How should touch-enabled devices be differentiates between pure touch and ones that also have a mouse? (like some of today's laptops) There is a need to give all mouse functionalit

Solution 1:

After some research, I have found that the best solution was to use this code:

https://github.com/matthewhudson/device.js

So, the way it works, is by giving the body element class names which represent the device and orientation, and with that I can pretty much guess if the user has a mouse. (class desktop is applied)

Post a Comment for "Javascript Detect Desktop Touch And Mouse Support"