Created
May 25, 2011 15:52
-
-
Save jordanharper/991223 to your computer and use it in GitHub Desktop.
Expansion of hitareas for links
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
$('.hitarea-container').each(function(){ | |
$(this).click(function(){ | |
$target = $(this).find('a.hitarea-source').first().attr('href'); | |
if ($target) window.location.href = $target; | |
}); | |
}); | |
// Relies on container to become 'clickable' having a class | |
// of 'hitarea-container' and the link that should be the | |
// target needs to be the href of the first link within that | |
// element with the class 'hitarea-source'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment