Since this is a cosmetic effect, it shouldn’t be too vital that this fires. Given that, you might want to look at CSS 3 transformations.
a {
color: #000;
transition: background 0.5s linear;
}
a:hover {
background-color: #d1d1d1;
color: #fff;
}
<a href="http://example.com">Hover me</a>