Created
September 20, 2009 19:44
-
-
Save keithnorm/189902 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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