Created
April 29, 2014 19:34
-
-
Save EvanAgee/11409846 to your computer and use it in GitHub Desktop.
Add hover on touch for mobile devices using jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("a").live("touchstart", function(e) { | |
$(this).trigger("hover"); | |
}); | |
$("a").live("touchend", function(e) { | |
$(this).trigger("blur"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi EvanAgee,
Just saw this, thought I'd comment :)
From the jQuery site:
jQuery version deprecated: 1.7, removed: 1.9
As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().