Is it possible to take my existing css for a mouseover link with a background image, and make it fade in and out? Which is the best approach for a fadein/out? I’m already using jquery.
.sendB {
width: 100%;
height: 125px;
background: #5266EB url('/img/send.gif') no-repeat 50% 0;
margin-top: 22px;
float: left;
}
.sendB:hover {
width: 100%;
height: 125px;
background: #00CE00 url('/img/send.gif') no-repeat 50% -125px;
margin-top: 22px;
float: left;
}
I don’t think you can access psuedoclasses with JavaScript.
However, if you changed that selector to also include
.sendB.hover, you could pick that up with jQuery.One thing to know is that you can’t fade a background image. You will need to fade an actual image or an element inside with a background image. You’ll need to use absolute positioning.