Last active
December 20, 2015 14:39
-
-
Save JasonStoltz/6147984 to your computer and use it in GitHub Desktop.
Sharing for Terry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Terry, here's a basic example of sharing. You specify ANY url in the addthis_share variable. Drop this into your console when on your site and you should see sharing buttons appear at the top of your page. | |
*/ | |
$.getScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51fd6b9d3d7d6b20', function(){ | |
/* Options for markup are documented here: | |
http://support.addthis.com/customer/portal/articles/381238-addthis-toolbox#.Uf1qlT770U4 | |
https://www.addthis.com/get/sharing#.Uf1wfj770U4 | |
*/ | |
var addthisMarkup = ""; | |
addthisMarkup += "<div id=\"ezbeads-share\" class=\"addthis_toolbox addthis_default_style \">"; | |
addthisMarkup += "<a class=\"addthis_button_preferred_1\"><\/a>"; | |
addthisMarkup += "<a class=\"addthis_button_preferred_2\"><\/a>"; | |
addthisMarkup += "<a class=\"addthis_button_preferred_3\"><\/a>"; | |
addthisMarkup += "<a class=\"addthis_button_preferred_4\"><\/a>"; | |
addthisMarkup += "<a class=\"addthis_button_compact\"><\/a>"; | |
addthisMarkup += "<a class=\"addthis_counter addthis_bubble_style\"><\/a></div>"; | |
var $addthisMarkup = $(addthisMarkup); | |
$('.art-layout-cell.art-content').prepend($addthisMarkup); | |
var addthis_share = window.addthis_share = | |
{ | |
url: 'http://www.google.com' | |
}; | |
// This is documented here: http://support.addthis.com/customer/portal/articles/381263-addthis-client-api#.Uf1qfj770U4 | |
addthis.toolbox('#ezbeads-share'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Terry, this dynamically adds the markup to the page because I'm assuming that you might not want to add it until after a user has created their necklace? AddThis's api is very flexible, let me know if this doesn't work and you need some additional help.