Skip to content

Instantly share code, notes, and snippets.

@andrewpthorp
Created May 18, 2012 15:51
Show Gist options
  • Save andrewpthorp/2725974 to your computer and use it in GitHub Desktop.
Save andrewpthorp/2725974 to your computer and use it in GitHub Desktop.
Hammer Questions
<div id="wrapper">
<div id="hammertime-inside-wrapper">This is a test</div>
</div>
<script>
$(function(){
$("#wrapper").hammer();
$("#hammertime-inside-wrapper").bind("tap", function(e) { console.log(e); });
});
</script>
<!--
How would I add hammer to a wrapper element and catch the events on it's children?
-->
@andrewpthorp
Copy link
Author

I know I can do something like this:

<div id="hammertime-inside-wrapper" class="hammertime">This is a test</div>
$(".hammertime").hammer();

Which is fine, I was just wondering if there was an easier way.

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