ShareBtns with counter (ShareThis)

Size
2,525 Kb
Views
44,528

How do I make an sharebtns with counter (sharethis)?

Facebook and Twitter sharebuttons made with counter, using ShareThis api. What is a sharebtns with counter (sharethis)? How do you make a sharebtns with counter (sharethis)? This script and codes were developed by Nicolaj Lund Nielsen on 07 September 2022, Wednesday.

ShareBtns with counter (ShareThis) Previews

ShareBtns with counter (ShareThis) - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>ShareBtns with counter (ShareThis)</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="tools"> <div class="st_facebook_custom" displayText='Facebook'> <div class="countbox"> <b>Del</b> <span id="fbcount"></span> </div> </div> <div class="st_twitter_custom" displayText='Twitter'> <div class="countbox"> <b>Del</b> <span id="twitcount"></span> </div> </div>
</div> <script src='https://wd.sharethis.com/button/buttons.js'></script> <script src="js/index.js"></script>
</body>
</html>

ShareBtns with counter (ShareThis) - Script Codes CSS Codes

.tools { text-align:left; padding:0; height:24px;
} .tools > div { cursor:pointer; float:left; height:24px; line-height:20px; color:#fff; background-position: 0 -1px; background-color:#e5e4e4; -webkit-border-radius: 12px; -moz-border-radius: 12px; border-radius: 12px; } .tools > div .countbox { width:0; overflow:hidden; -webkit-transition: width .4s ease-out; -moz-transition: width .4s ease-out; -ms-transition: width .4s ease-out; -o-transition: width .4s ease-out; transition: width .2s ease-out; } .tools > div .countbox.shared, .tools > div .countbox.shared { width:56px; } .tools > div .countbox span { text-align:center; display:inline-block; width:24px; line-height:20px; padding:2px 0; margin-left:4px; }
#print { margin:5px 0 0 7px; height:18px;
} #print span { text-indent:-9999px; }
div.st_facebook_custom { margin-left:10px; padding-left:24px; background: url(http://html5.dis-play.dk/testcenter/nicolaj/dump/facebook.png) no-repeat; background-color:#3E5B97
} .st_facebook_custom span { border-left:1px solid #2f477f; color:#8ca8e6; }
div.st_twitter_custom { margin-left:10px; padding-left:24px; background:url(http://html5.dis-play.dk/testcenter/nicolaj/dump/twitter.png) no-repeat; background-color:#2AA7DE
} .st_twitter_custom span { border-left:1px solid #0095d1; color:#04789f; }

ShareBtns with counter (ShareThis) - Script Codes JS Codes

var fbCount = document.getElementById('fbcount');
var twitCount = document.getElementById('twitcount');
var shareUrl = encodeURIComponent(document.location.href);
stLight.options({ publisher: '249941c7-9ea8-401d-93e9-3b4763632ce3', doNotHash: false, doNotCopy: true, hashAddressBar: true });
stButtons.getCount(shareUrl, "facebook", fbCount);
stButtons.getCount(shareUrl, "twitter", twitCount);
var checkInterval = setInterval(checkShareBtns, 100);
function checkShareBtns() { if(fbCount.innerHTML !== ""){ clearInterval(checkInterval); if (fbCount.innerHTML !== "0") { fbCount.parentNode.className = "countbox shared"; } if (twitCount.innerHTML !== "0") { twitCount.parentNode.className = "countbox shared"; } }
}
ShareBtns with counter (ShareThis) - Script Codes
ShareBtns with counter (ShareThis) - Script Codes
Home Page Home
Developer Nicolaj Lund Nielsen
Username nicolund
Uploaded September 07, 2022
Rating 3
Size 2,525 Kb
Views 44,528
Do you need developer help for ShareBtns with counter (ShareThis)?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Nicolaj Lund Nielsen (nicolund) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!