Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created August 9, 2012 00:07
Show Gist options
  • Save themorgantown/3299870 to your computer and use it in GitHub Desktop.
Save themorgantown/3299870 to your computer and use it in GitHub Desktop.
convert hover taps
<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