Skip to content

Instantly share code, notes, and snippets.

@mtabini
Created October 17, 2011 17:43
Show Gist options
  • Save mtabini/1293228 to your computer and use it in GitHub Desktop.
Save mtabini/1293228 to your computer and use it in GitHub Desktop.
<div class="swipe">
<img src="img/swipe-annotation.png" height="30" link="bookmark"><img src="img/swipe-favourite.png" height="30" link="favourite"><img src="img/swipe-pencil.png" height="30" link="annotate"><img src="img/swipe-email.png" height="30" link="email"><img src="img/swipe-tweet.png" height="30" link="tweet"><img src="img/swipe-facebook.png" height="30" link="facebook">
</div>
In your JS (assuming you have jQuery, otherwise will need to adjust accordingly):
$(".swipe img[link]").click(function() {
document.location.href = $(this).attr("link") + "://" + $(this).attr("link");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment