Yii Framework Forum: Detect "touch" Devices (Not "mobile") - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Detect "touch" Devices (Not "mobile") Rollovers issue Rate Topic: -----

#1 User is offline   Ziggi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 14-August 12

Posted 07 February 2013 - 02:31 PM

Hi,

I really do not have any temptation to own a tablet or any other "touch device". I am a happy ultrabook user so I was surprised my customer complained:

- Hi Ziggi, the site you've developed is good but we can't use mouse rollover on iPads!

It was not nice, indeed >:(

Well, stupid iPad does not make any use of "double-tap" and simply ignore all my carefully build rollover effects (wasn't Steve Jobs just a conceited a..hole?).

Because all the other stuff is showing fine on modern mobile devices, the question is - how to tell a device is a "touch" device with no mouse rollovers implementation???

Specifically I need to show some completely different menu system on such devices.

Please advice!
0

#2 User is offline   Luke Jurgs 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 16-October 11
  • Location:Australia

Posted 07 February 2013 - 04:04 PM

Hi Ziggi,

This is tricky because it is all about what the browser will tell us, Modernizr is a Javascript library that is able to detect touch suport (apparently not perfectly). It has both Javascript and CSS query support so you might try it out, I'm not aware of any way to do it on the server side - you could maintain a list of devices and check against them but this is a lot of curation.

Good luck.
0

#3 User is offline   Ziggi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 14-August 12

Posted 07 February 2013 - 07:51 PM

Nasty thing - isn't it?

Rgs,
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users