9

Bit of a weird one. I have a site I am working on. But, on my laptop (ASUS Zenbook) some of the features do not work. We spent a good amount of time using Firebug to try and get it working/work out what it was, with no joy!

I then noticed that these features were actually created in CSS using :hover classes, but were also disabled for touch devices by including the class ".no-touch".

I then looked at the classes that Modernizr had added to the HTML tag and ".touch" had been added along with the standard.

So it seems, Modernizr is viewing my laptop, in Firefox and Chrome, as a touch device.

Obviously, this could be an issue for when the site goes live in that some features will not work for anyone using a Zenbook and any other devices that acts in the same way.

Has anyone seen anything like this before? Maybe with other "non-touch" devices?

2
  • Doesn't the Asus Zenbook have a touch screen? I'm not sure how to force touch mode off, however. This sounds like something that will get a meta tag.
    – GiantDuck
    Nov 23, 2012 at 21:05
  • No, it's a standard laptop! Nov 24, 2012 at 1:33

1 Answer 1

9

Unfortunately Modernizr tests for support of Touch-events in the browser, so it's not a proper test for a touch device. Last builds of Chrome and Firefox are supporting this feature.

You can check the issue here: https://github.com/Modernizr/Modernizr/issues/548

I'm searching for a good solution on this matter too, but the only thing I've found is this, though I haven't tested it out yet: https://stackoverflow.com/a/4819886/1262357

If you have good results please let me know!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.