iceman19330
asked on
swap out image on hover
Had a question the other day that was answered and after closing the question I noticed I had forgotten to ask about swapping the image that is supposed to accompany the text.
heres a link to the page: http://tinyurl.com/6lxhxww
heres a link to the page: http://tinyurl.com/6lxhxww
$('.item-category ul li a').hover(function(){
var divToShow = this.id.substring(1);
$('.subcat-details.active').fadeOut('fast',function(){
$(this).removeClass("active"); // remove the active from the previously active div
$("#"+divToShow).addClass('active').fadeIn('fast'); // the id of the link is Xsubcat-n
alert("#"+divToShow);
});
});
ASKER
humm would I have to use inline css for that since its a cms thats generating the output.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If the solution has helped you. please award the points.
ASKER
Not sure it has. This is a data driven page and I cant do much it the css since it is separate. Maybe I am not thinking about this solution the same way.
?
So what if css separate. You modify it or add head css.
the solution pretty simple, the code you write to add hover effect also write function hover-out in same, as shown in my example.
thats it.
So what if css separate. You modify it or add head css.
the solution pretty simple, the code you write to add hover effect also write function hover-out in same, as shown in my example.
thats it.
after you add the new css class, thats it.
the new css should have background-url as image.