On my new site, I have several different hover states for links. One swaps out a background image for the logo. One swaps out a different background image for the main nav. And normal inline links change background colors via CSS. I can't figure out a way to automatically have all a tags animate gracefully to their hover state.
It doesn't seem very clean (or future-proof) to manually code animation methods for each of these link types. It doesn't seem right to be putting my background image URLs and link colors (which should be in CSS) into JS. And it doesn't seem right to create a special class for each instance of a hover effect, then animate the addition/removal of that class via jQuery, when there could be a way to use the default a:hover behavior that CSS provides.
So I just wanted to know if there's some way to get jQuery (either with or without jQuery UI) to crossfade between the a and a:hover states that are already defined in my CSS. All of the a:hover states work as expected, but the transition is too sudden, and I want to add a fade transition between the hover/non-hover state of each element.
Any suggestions? Here's one example of CSS hover states where I'd like to animate the transition:
#logo a, #logo a:visited {
background: url('logo_black.png');
}
#logo a:hover {
background: url('logo_white.png');
}