I'm having some problems with the method switchClass.
I want to add/remove a css class (newsHover
) when the mouse is hover the class newsArea
with some transition.
I have the following code
$('.newsArea').mouseover(function(){
$(this).switchClass('','newsHover',500, 'linear');
}).mouseleave(function(){
$(this).switchClass('newsHover','',500);
});
I think the methods are correct as you can see: http://docs.jquery.com/UI/Effects/ClassTransitions and http://jqueryui.com/docs/switchClass/
The newsHover class has a background-image:
.newsHover{
background-image: url("../../images/newsArea-hover.png");
background-repeat: no-repeat;
background-position:left top;
width: 200px; height: 52px;
}
The image appears but without any transition. It appears after the 500 milliseconds.
I can accept any solution with css3 cross-browser.
Any tips here??
thanks
EDIT
I forgot to tell that I'm using the 1.7.2 jquery version; jquery.easing.1.3, and jquery-ui-1.8.23.custom.min (with all the components selected)