Skip to content

Instantly share code, notes, and snippets.

@ntreadway
Created November 17, 2010 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntreadway/702877 to your computer and use it in GitHub Desktop.
Save ntreadway/702877 to your computer and use it in GitHub Desktop.
Simple iphone js onclick function to simulate :hover
- 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");
});
}
@ntreadway
Copy link
Author

Uses Haml and JQuery

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