$(document).ready(function(){
$(".thumbnail").hover(
function(){
$(".overthumb").fadeTo(1000,1).show();
},
function(){
$(".overthumb").fadeTo(1000,0).hide();
}
);
});
http://jsfiddle.net/AndyMP/qCa7a/2/
The code above makes a DIV fade in, but for some reason won’t fade out.
Maybe FadeOut isn’t the best way of doing this?
As Daniel has said, you don’t need to call
hide(), however you also don’t need to callshow().A side note – you’re using the function
fadeTo()which is mainly used to fade an element to a specific opacity value (i.e. 4%). Seeing as you’re just fading the element from 0% – 100% and vice versa, you can use these functions respectively:fadeIn()&fadeOut().Here’s an example of using the above functions:
Here are the link to the jQueryAPI document for the following functions: fadeIn() & fadeOut()