JSFiddle - React, Tailwind, and code Playground
HTML
<div class="d1"></div>
CSS
.d1{
width:20px;
height:20px; background:url(http://www.nuoyidata.com/templets/heibai/images/menu_ico1.png) no-repeat;
background-position:0 0;
}
JavaScript
$(function(){
$(".d1").hover(function(){
$(this).animate({
"background-position-x":"0",
"background-position-y":"-29px"
},500);
},function(){
$(this).animate({
"background-position-x":"0",
"background-position-y":"0"
},500);
});
});