Created
August 9, 2012 00:07
-
-
Save themorgantown/3299870 to your computer and use it in GitHub Desktop.
convert hover taps
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
// if(navigator.platform == "iPad") | |
if (navigator && navigator.platform && navigator.platform.match(/^(iPad|iPod|iPhone)$/)) { | |
$("a").each(function() { // have to use an `each` here - either a jQuery `each` or a `for(...)` loop | |
var onClick; // this will be a function | |
var firstClick = function() { | |
onClick = secondClick; | |
return false; | |
}; | |
var secondClick = function() { | |
onClick = firstClick; | |
return true; | |
}; | |
onClick = firstClick; | |
$(this).click(function() { | |
return onClick(); | |
}); | |
}); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment