Skip to content

Instantly share code, notes, and snippets.

@terkel
Last active December 15, 2015 18:59
Show Gist options
  • Save terkel/5307401 to your computer and use it in GitHub Desktop.
Save terkel/5307401 to your computer and use it in GitHub Desktop.
$(document).on('mouseenter', function (event) { /* ... */ });
$(document).on('mouseenter focus', function (event) { /* ... */ });
$(document).on('mouseenter', '.foo', function (event) { /* ... */ });
$(document).on('mouseenter', '.foo, .bar', function (event) { /* ... */ });
$(document).on({
mouseenter: function (event) { /* ... */ },
mouseleave: function (event) { /* ... */ }
});
$(document).on({
'mouseenter focus': function (event) { /* ... */ },
'mouseleave blur': function (event) { /* ... */ }
});
$(document).on({
mouseenter: function (event) { /* ... */ },
mouseleave: function (event) { /* ... */ }
}, '.foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment