I have a roll over effect on a <h3>Some header</h3> and I want the background to fadein/fadeout nicely on hover.
its normal state is:
h3 {
background: none;
}
and the hover is a css3 animation:
h3:hover {
background-image: linear-gradient(bottom, #FFFFFF 25%, #FCFCFC 100%);
background-image: -o-linear-gradient(bottom, #FFFFFF 25%, #FCFCFC 100%);
background-image: -moz-linear-gradient(bottom, #FFFFFF 25%, #FCFCFC 100%);
background-image: -webkit-linear-gradient(bottom, #FFFFFF 25%, #FCFCFC 100%);
background-image: -ms-linear-gradient(bottom, #FFFFFF 25%, #FCFCFC 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, #FFFFFF),
color-stop(1, #FCFCFC)
);
}
since I have so many rules – I can’t do it in jQuery simple animatie (or can I?).
Can it be done without using any plugins or jQuery ui kits? Or – is it possible to achieve it in a css3 animation? I tried css3 animtation by adding to h3 this code, but it made weird effects and not at all the simple fadein:
h3 {
-webkit-transition: all 0.1s ease-out; /* Saf3.2+, Chrome */
-moz-transition: all 0.3s ease-out; /* FF4+ */
-ms-transition: all 0.3s ease-out; /* IE10? */
-o-transition: all 0.3s ease-out; /* Opera 10.5+ */
transition: all 0.3s ease-out;
}
thanks,
Alon
You can do it like this with jQuery.
CSS:
JavaScript: