Skip to content

Instantly share code, notes, and snippets.

@jordanharper
Created May 25, 2011 15:52
Show Gist options
  • Save jordanharper/991223 to your computer and use it in GitHub Desktop.
Save jordanharper/991223 to your computer and use it in GitHub Desktop.
Expansion of hitareas for links
$('.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