0

我想制作这个 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);
});

你知道如何解决这个问题吗?非常感谢!

4

2 回答 2

1

试试这个,它具有来自 jQuery Ui 的强大内置功能。

于 2011-02-07T23:22:11.960 回答
0

这是 Jquery 的缓动插件:

http://gsgd.co.uk/sandbox/jquery/easing/#example

为了给背景属性设置动画,你需要CSS 钩子——查看这个以了解更多关于它们的信息。

于 2011-02-07T23:22:45.770 回答