Skip to content

Instantly share code, notes, and snippets.

@lukeandersen
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save lukeandersen/11371219 to your computer and use it in GitHub Desktop.

Select an option

Save lukeandersen/11371219 to your computer and use it in GitHub Desktop.
Stupidly simple social sharing buttons
<div class="post-share">
<a class="icon-facebook-sign" href="https://www.facebook.com/sharer/sharer.php?u={PAGE URL}"></a>
<a class="icon-twitter-sign" href="https://twitter.com/intent/tweet?url={PAGE URL}&text={PAGE TITLE}}via={SITE NAME}"></a>
<a class="icon-pinterest-sign" href="http://pinterest.com/pin/create/button/?url={PAGE URL}&media={POST IMAGE URL}&description={PAGE TITLE}" title="Pin It"></a>
<a class="icon-google-plus-sign" href="https://plus.google.com/share?url={PAGE URL}"></a>
</div>
<script>
// requires jQuery
$('.post-share a').each(function() {
$(this).on('click', function(e) {
e.preventDefault(),
window.open(this.href,"targetWindow","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=620,height=340").moveTo(0,300)
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment