Skip to content Skip to sidebar Skip to footer

Hover Effect On A Tablet (i.e. Ipad)?

I'm the processing of redesigning a website that uses hover effect on a button (like button images changes when you put your mouse over it and when you click it, it goes to a diffe

Solution 1:

Touch devices don't have a hover event and there is no way to emulate the user interaction that might initiate it. Make sure that there is no critical functionality assocaited with hover events (most just do highlighting) so there is no loss of functionality if the device doesn't have it. Browser sniffing by UA string is a flawed strategy - you must update it every time a new device comes along or the string changes for an existing device. Great if you're into high prices for maintenance, but not if you're the one paying for it.

Solution 2:

You could identify the iPad (or mobile device) simply by checking the User-Agent parameter of the browser.

In PHP for example you could do something like:

if( strstr($_SERVER['HTTP_USER_AGENT'],'iPad') ) { // Add custom iPad CSS }

If you want to get it further you could use WURFL (http://wurfl.sourceforge.net/)

Post a Comment for "Hover Effect On A Tablet (i.e. Ipad)?"