Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jQuery - Mouse hover on touch devices
//taphover - a solution to the lack of hover on touch devices.
//more info:
$('a.taphover').on('touchstart', function (e) {
'use strict'; //satisfy the code inspectors
var link = $(this); //preselect the link
if (link.hasClass('hover')) {
return true;
} else {
return false; //extra, and to make sure the function has consistent return points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.