How do I create my own custom ShareThis button?

In order to create your own custom ShareThis button you must first turn off our output of the button by setting the “button” API option to “false”. Then you can create your own button out of HTML and then bind our SHARETHIS.addEntry code to it.

You may modify the ShareThis button icon to use different colors or sizes but the shape and look should be maintained. You can get the ShareThis icon image files here.

Below is an example of this ShareThis API procedure:


<script language="javascript" type="text/javascript">
//Create your sharelet with desired properties and set button element to false
var object = SHARETHIS.addEntry({
title:'share',
summary: 'Sharing is good for the soul.'},
{button:false});
//Output your customized button
document.write('<span id="share"><a href="javascript:void(0);"><img src="/my_share_icon.gif" />Share!</a></span>');
//Tie customized button to ShareThis button functionality.
var element = document.getElementById("share");
object.attachButton(element);
</script>

Popularity: 41%