0

I am creating links in which their background change on mouse hover it's easy to make this with CSS but I want a fade-out effect for the original background showing the hover one slowly. I want to use a jQuery Plugin to make this fade (in/out) effect apply to links having certain classes.

All I want is that to make the .CLASS:hover fade in when hovering or .CLASS to fade out showing .CLASS:hover slowly... without changing to different classes in which one for the original background and the other for the hovering one.

2 Answers2

1

You can do it with CSS3-Transitions. Support is great (all modern browsers, even IE)

#foo {background:red; @include transition(background 1s)}
#foo:hover {background:yellow}

Pure CSS:

#foo {
background:red;
-webkit-transition:background 1s;
-moz-transition:background 1s;
-o-transition:background 1s;
transition:background 1s
}

#foo:hover {background:yellow}
coder
  • 13,002
  • 31
  • 112
  • 214
0

You can do this with css3

.CLASS{
    background: <put the color here>;
    transition: background 0.5 ease;
}
.CLASS:hover{
    background: <put the other color here>;
}
anacarolinats
  • 667
  • 8
  • 19