Skip to content

Instantly share code, notes, and snippets.

@ludofleury
Forked from tyx/gist:816180
Created February 15, 2011 20:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludofleury/828193 to your computer and use it in GitHub Desktop.
Save ludofleury/828193 to your computer and use it in GitHub Desktop.
// Ouvre le premier lien enfant de l'élément cible
// Reproduit le comportement des navigateurs (ctrl ou cmd ou middleclick = nouvel onglet)
$('.line-click').live('click', function(e){
e.stopPropagation();
href = $(this).children('a:first').attr('href');
if (e.ctrlKey || e.metaKey || e.which == 2) {
window.open(href);
} else {
window.location = href;
}
}).css('cursor', 'pointer');test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment