我想制作这个 css3 效果的 jquery 版本,以便它也适用于 ff 和 ie:
a:hover {color: #354250; -webkit-transition:background 500ms ease-in;}
a.more:hover, a.more:focus, a.more:active {background-position: 0 -18px;}
a.more:link, a.more:visited {
background: url(images/moreButton.png) no-repeat 0 0;
display: inline-block;
height:18px;
margin-top:10px;
text-indent: -9999px;
width:77px;
}
我的尝试没有奏效,这是我目前所得到的。
$("a.more").hover(function() {
$(this).stop().animate({ color: '#354250', backgroundPosition: '0px -18px' }, slow, function() {
$(this).stop().animate({ color: '#ad5332', backgroundPosition: '0px 0px'}, 0);
});
}, function() {
$(this).stop().animate({ color: '#ad5332', backgroundPosition: '0px 0px' }, 0);
});
你知道如何解决这个问题吗?非常感谢!