Skip to content

Instantly share code, notes, and snippets.

@opi
Created May 9, 2012 18:24
Show Gist options
  • Save opi/2647663 to your computer and use it in GitHub Desktop.
Save opi/2647663 to your computer and use it in GitHub Desktop.
Enlarge Your Click
$.fn.enlargeYourClick = function(selector){
$(selector).click(function(e){
// don't handle if user click on a link, or if he click with mouse wheel
if (e.target.tagName != "A" && e.button != 1) {
var dest = $(this).find('a:first').attr('href');
if (dest) {window.location = dest};
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment