Skip to content

Instantly share code, notes, and snippets.

@keithnorm
Created September 20, 2009 19:44
Show Gist options
  • Save keithnorm/189902 to your computer and use it in GitHub Desktop.
Save keithnorm/189902 to your computer and use it in GitHub Desktop.
(function($){
$.fn.bigClickNYC = function(selector) {
var selector = selector || "a";
return this.each(function(){
$(this).click(function(e){
e.preventDefault();
if($(this).is(selector))
$(window).attr("location", $(this).attr("href"));
else if($(this).find(selector).length > 0)
$(window).attr("location", $(this).find(selector).attr("href"));
else{
//do nothing NYC!
}
});
$(this).mouseover(function(e){
$(this).css({"cursor": "pointer"})
})
});
}
})(jQuery);
/* for example say you have this html
<li>
<div>
<a href="somelink.html">small little link</a>
</div>
</li>
you could do this:
$("li").bigClickNYC();
and then the whole li because the clickable area
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment