JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.0/css/font-awesome.min.css">
<div>
<ul>
<li><a href="#" class="like l-fb"><i class="l-ico icon-facebook-sign"></i><span class="l-count"></span></a>
<li><a href="#" class="like l-tw"><i class="l-ico icon-twitter"></i><span class="l-count"></span></a></li>
<li><a href="#" class="like l-vk"><i class="l-ico icon-vk"></i> <span class="l-count"></span></a></li>
</ul>
</div>
CSS
.likes-block {
line-height:24px;
height:24px;
text-align:right;
margin-bottom: 30px;
}
.like {
display:inline-block;
height:24px;
position:relative;
min-width:25px;
vertical-align:top;
text-align:center;
padding:0;
}
.likes-block .like:first-child {
margin-left:10px;
}
.like .l-ico {
position:absolute;
top:2px;
left:0px;
font-size: 14px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 1.0);
}
.like .l-count {
vertical-align:middle;
cursor: default;
font-size: 10px;
}
.like.like-not-empty {
background: url();
margin-right:0px;
padding:0 0 0 15px;
}
a.like {
text-decoration: none;
}
JavaScript
(function (c, l, h, b) {
function k(o) {
if (o) {
var p = top.location.search.replace(/^\?/, "").split("&");
for (var n in p) {
var q = p[n];
var d = q.match(/([^=]*)=(\w*)/);
if (d[1] === o) {
return decodeURIComponent(d[2])
}
}
}
return false
}
var m = function (d) {
if (d) {
return c.extend(true, {}, m.defaults, d)
}
return m.defaults
};
m.defaults = {
selectors: {
facebookButton: ".l-fb",
twitterButton: ".l-tw",
vkontakteButton: ".l-vk",
count: ".l-count",
ico: ".l-ico",
shareTitle: "h2:eq(0)",
shareSumary: "p:eq(0)",
shareImages: "img[src]"
},
buttonDepth: 2,
alternativeImage: "",
alternativeSummary: "",
alternativeTitle: "",
forceAlternativeImage: false,
forceAlternativeSummary: false,
forceAlternativeTitle: false,
classes: {
countVisibleClass: "like-not-empty"
},
keys: {
shareLinkParam: "href"
},
popupWindowOptions: ["left=0", "top=0", "width=500", "height=250", "personalbar=0", "toolbar=0", "scrollbars=1", "resizable=1"]
};
var e = function () {};
e.lastIndex = 0;
e.prototype = {
init: function (d, o, n) {
this.config = o;
this.index = n;
this.$context = d;
this.$count = c(this.config.selectors.count, this.$context);
this.$ico = c(this.config.selectors.ico, this.$context);
this.collectShareInfo();
this.bindEvents();
this.ajaxRequest = this.countLikes()
},
bindEvents: function () {
this.$context.bind("click", e.returnFalse);
this.$ico.bind("click", this,...