Created
November 17, 2010 02:14
-
-
Save ntreadway/702877 to your computer and use it in GitHub Desktop.
Simple iphone js onclick function to simulate :hover
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
- content_for :js do | |
- javascript_tag do | |
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) | |
||(navigator.userAgent.match(/iPad/i))) { | |
$(".nav li a").click(function(){ | |
$(".nav li a").removeClass("hover"); | |
$(this).addClass("hover"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses Haml and JQuery