Search code examples
jquerycsswebkitcss-transitions

jquery equivalent for css3 transition ease-in


I want to make a jquery version of this css3 effect so that it also works in ff and 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;
}

My tries didn't work, here is what I' ve got so far.

    $("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);
});

Do you have any idea how to fix this? Thank you very much!


Solution

  • Try this, it has great built in features from jQuery Ui.