Per our unmaintained repository status documentation this repository is in an as-is state and is no longer accepting issue reports or pull requests.
Copyright (c) 2012 Filament Group, developed by @zachleat. MIT licensed.
Related: Filament Group Lab Post
The problems with social networking widgets are well documented. They're heavy and slow to load especially on high-latency mobile connections.
SocialCount is a small jQuery plugin for progressively enhanced, lazy loaded, mobile friendly social networking widgets.
Note that while this project is named SocialCount, the server side code to fetch the share counts was removed. Both Twitter and Facebook have or will remove their public share count APIs. This functionality is going bye bye.
Install via NPM (
npm install --save fg-socialcount).
Alternatively, the following archive contains both minified (
socialcount.min.css) and unminified (
socialcount.css) versions of the JS and CSS required to use SocialCount.
By default, the social networking icons are not included. However, SocialCount publishes a version that does include the social networking icons: Use the regular
socialcount-with-icons.min.css and the included SD and HD image sprites.
Customize the sample markup below or use the provided markup generator.
<!-- Replace YOUR_CUSTOM_URL with the URL you're sharing --> <ul class="socialcount" data-url="YOUR_CUSTOM_URL"> <li class="facebook"><a href="https://www.facebook.com/sharer/sharer.php?u=YOUR_CUSTOM_URL" title="Share on Facebook"><span class="social-icon icon-facebook"></span><span class="count">Like</span></a></li> <li class="twitter"><a href="https://twitter.com/intent/tweet?text=YOUR_CUSTOM_URL" title="Share on Twitter"><span class="social-icon icon-twitter"></span><span class="count">Tweet</span></a></li> <li class="googleplus"><a href="https://plus.google.com/share?url=YOUR_CUSTOM_URL" title="Share on Google Plus"><span class="social-icon icon-googleplus"></span><span class="count">+1</span></a></li> </ul>
Touchscreens (Links Only)
grunt qunit command.
v0.1.1Fix for IE (tested up to 9) issue with iframes and :hover rules
v0.1.2Default AJAX request for counts to false, added zip download, better documentation for counts service.
v0.1.3Added code to normalize service url directory (easier configuration).
v0.1.4Fix for twitter widget share of non-current page URL. Added data-share-text.
v0.1.5Option for activate on click, instead of hover. i18n Code, adds de_DE support. Fix for Google+ issue with disappearing tooltip. Local url filtering on counts service. More accurate Facebook counts.
v0.1.6Added Pinterest button. Thanks @dustMason! Fix for IE10 support (wasn’t passing A-Grade test). Facebook button requires long form locale. Tweaks to German button sizes.
v0.1.7Bug fix: #42
v0.1.8Bug fix: #45
v0.2.0Removes Twitter from service, per Twitter’s API retirement.
SocialCount.activateOnClick = false;Global option to switch from load triggering on hover to a manual click.
SocialCount.thousandCharacter = 'K';
SocialCount.millionCharacter = 'M';i18n Strings.
SocialCount.load( $element )to programmatically load all of the SocialCount buttons in the
$elementobject. You can pass a container with multiple types of buttons or a single button.