Skip to content

Instantly share code, notes, and snippets.

@marco-van-zomeren
Created December 8, 2018 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marco-van-zomeren/f5d815abf4a631502b190019cebe7f70 to your computer and use it in GitHub Desktop.
Save marco-van-zomeren/f5d815abf4a631502b190019cebe7f70 to your computer and use it in GitHub Desktop.
// SHARE PAGE
$(document).ready(function () {
$('.js__share-page a.share-page__on-facebook').click(function () {
var link = $(location).attr('href');
var facebookUrl = "https://www.facebook.com/sharer/sharer.php?u=" + link;
window.open(facebookUrl);
});
$('.js__share-page a.share-page__on-twitter').click(function () {
var link = $(location).attr('href');
var twitterUrl = "https://twitter.com/intent/tweet?url=" + link + '&text=' + "Hey, bekijk eens:" + link;
window.open(twitterUrl);
});
$('.js__share-page a.share-page__on-linkedin').click(function () {
var link = $(location).attr('href');
var twitterUrl = "https://www.linkedin.com/shareArticle?mini=true&url=" + link + '&text=' + "Hey, bekijk eens:" + link;
window.open(twitterUrl);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment