Link to home
Start Free TrialLog in
Avatar of iceman19330
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


$('.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);
		});
	});

Open in new window

Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

what extra you want to do.
after you add the new css class, thats it.
the new css should have background-url as image.
Avatar of iceman19330
iceman19330

ASKER

humm would I have to use inline css for that since its a cms thats generating the output.
ASKER CERTIFIED SOLUTION
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If the solution has helped you. please award the points.
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.