disable hover and active pseudo class for mobile devices

Sjyjahqvfbkg

New Member
Is it possible to disable the hover and active pseudo classes for mobile devices only?I've found this\[code\]html.touch { /* Touch is enabled */}html.no-touch { /* Touch is disabled */}\[/code\]Which seems pretty neat. But I can't get it to work.The code is below, and you can test it here: http://jsfiddle.net/5qb2J/\[code\]<html><head><style type="text/css">#button{background:url("http://www.webstuffshare.com/wp-content/uploads/2010/03/button3.jpg") no-repeat 0 0;display:block;width:201px;height:67px;}#button:hover{background-position:0px -67px;}#button:active{background-position:0px -134px;}#button span{position:absolute;top:-99999999em;}</style> </head><body><a id="button" href="http://stackoverflow.com/questions/10659577/#"><span>this is foo</span></a></body></html>\[/code\]editI'm using this now\[code\]<?php // detect mobile$Mobile = FALSE;if(strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "android") ||strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "webos") ||strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "iphone") ||strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "ipod") ||strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "ipad") ||strstr(strtolower($_SERVER["HTTP_USER_AGENT"]), "zune")){$Mobile = TRUE;}?>\[/code\]and\[code\]<?phpIf ($Mobile == FALSE){echo <<<escapethissome html hereescapethis;}?>\[/code\]the lines that use the word escapethis can not begin with a space
 
Top