Skip to content

Instantly share code, notes, and snippets.

@avinayak
Last active November 2, 2015 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avinayak/a1a6de2deb269abdc477 to your computer and use it in GitHub Desktop.
Save avinayak/a1a6de2deb269abdc477 to your computer and use it in GitHub Desktop.
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
function ll (argument) {
$(".bar").hover(
function(){
$(".vote").stop().animate({
left:'40px',opacity:1.0
},'normal');
// This only fires if the row is not undergoing an animation when you mouseover it
},
function() {
$(".vote").stop().animate({
left:'0px',opacity:0.0
},'normal');
});
}
</script>
<style type="text/css">
.vote{
position: absolute;
left: 0px;
z-index: 0;
opacity: 0;
}
.like{
position: absolute;
left: 0px;
z-index: 1;
}
a{
color:#999999;
}
.counter-like{
margin-top: 5px;
font-size: 12px;
text-align: center;
}
.counter-vote{
margin-top: 5px;
font-size: 12px;
text-align: center;
}
</style>
</head>
<body onload="ll(2)">
<div class="bar" style="height: 17px;width: 40px;">
<a href="#lol"><i class="like fa fa-heart fa-lg"><div class="counter-like">44</div></i></a><a href="#hart"><i class="vote fa fa-star fa-lg"><div class="counter-vote">43</div></i></a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment