Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created July 7, 2015 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/abea14bbf21da5df5b76 to your computer and use it in GitHub Desktop.
Save billerickson/abea14bbf21da5df5b76 to your computer and use it in GitHub Desktop.
<?php
/**
* Body Classes
*
*/
function be_body_classes( $classes ) {
$classes[] = 'no-touch';
return $classes;
}
add_filter( 'body_class', 'be_body_classes' );
jQuery(function($){
// Touch Device Detection
var isTouchDevice = 'ontouchstart' in document.documentElement;
if( isTouchDevice ) {
$('body').removeClass('no-touch');
}
});
@erwstout
Copy link

erwstout commented Aug 8, 2016

So in this instance, are you then just killing any hover states via css to do the work around? Just curious how you would approach the hover issue on iOS... I suppose you could also always do something like $('#element').tap()....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment