Is it possible to fade animate all css properties of one style with jQuery when hovering? And I mean if you have defined a style and its :hover state only with css, the script to do the rest. Example:
.button1 {
background: url(img1.jpg) repeat-x top left;
color: #000;
}
.button1:hover {
background: url(img2.jpg) repeat-x top left;
color: #F00;
}
And if you want the jQuery script to do the same to many similar buttons, is it possible? Or the only way is to define two different css styles?
You could replace your hover css with a class and use the jquery UI
ToggleClassanimation:css:
javascript:
If you want to use both the css hover and the javascript hover, I guess you will have to cancel the default action in the javascript
hoverfunction.Edit: To answer your other question, the javascript above will be applied to all buttons with the
.button1class but if you would like to add it to.button2too, you can use for example: