Skip to content

Instantly share code, notes, and snippets.

@ozknozsrt
Created June 19, 2018 14:34
Show Gist options
  • Save ozknozsrt/f2d44e5094889d6db912a338382e6e57 to your computer and use it in GitHub Desktop.
Save ozknozsrt/f2d44e5094889d6db912a338382e6e57 to your computer and use it in GitHub Desktop.
social popup share
var myhref = window.location.href,
facebookHref = "https://facebook.com/sharer.php?u=" + myhref,
twitterHref = "https://twitter.com/intent/tweet?url=" + myhref,
shareOptions = 'location=yes,height=500,width=500,scrollbars=yes,status=yes';
$('.facebook-share').click(function() {
window.open(facebookHref, '_blank', shareOptions);
});
$('.twitter-share').click(function() {
window.open(twitterHref, '_blank', shareOptions);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment