This ease transitioning stuff is all a bit new to me so apologies if its obvious!
I have a menu and each <li> has its own class as the background image for each is different.
What i’m trying to do is get the background image on the hover to fade in over the top of the original. I dont want the original to start off with a lower opacity etc, and i just want it to apply to the background-image, nothing else. Can this be done?? Ive tried a number of different things but nothing seems to be working…
Or you could use CSS3 for browsers that support it.
#sub_nav li {
-webkit-transition: background linear .3s;
-moz-transition: background linear .3s;
-o-transition: background linear .3s;
-ms-transition: background linear .3s;
transition: background linear .3s;
}
ralph.m,
I tried that but unfortunately it didnt work… Ive got the css ease working really well on other navigation menus that change background-colour, but for some reason it wont work for a background-image.
I’ll have a crack at RyanReese’s jquery suggestion…
You need to place the transition rules on the <a>, not the <li>. Then place whatever is to change on your a:hover rules.
What i’m trying to do is get the background image on the hover to fade in over the top of the original.
The problem I see is that you are loading a new image on hover, that will give some delay and conflict with the transition timing. You will be much better off merging the two states together into one sprite image and then just changing BG positions on hover. That should give you the effect your after without any loading delays.