Skip to content

Instantly share code, notes, and snippets.

@hzlzh
Created July 18, 2012 11:20
Show Gist options
  • Save hzlzh/3135645 to your computer and use it in GitHub Desktop.
Save hzlzh/3135645 to your computer and use it in GitHub Desktop.
Js touch event for iPad
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".submit-btn").bind("touchend", function(event) {
$(this).addClass('hover')
// your fn()
$(this).removeClass('hover')
});
$(".more").bind("touchend", function(event) {
$(this).addClass('hover')
// your fn()
$(this).removeClass('hover')
});
$(".share").each(function(index) {
$(this).bind("touchend", function(event) {
$(this).addClass('hover')
// your fn() with `index`
$(this).removeClass('hover')
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment