Reputation: 99
Hi I would like to implement a Fade in / Fade out effect on my hover, How Can I do this cause I need to keep position of cursor for Text Displayed.
$(function() {
$("#static .wrapper").hover(function (e) {
var parentOffset = $(this).parent().offset();
var relX = e.pageX - parentOffset.left;
$(this).children(".hidden-content").css("left", relX);
});
});
Thx for help !
Upvotes: 0
Views: 104
Reputation: 2763
I have made some changes to your code. This should work. I added this line among other things:
$(this).children(".hidden-content").fadeIn('slow');
Upvotes: 0
Reputation: 103428
Use CSS3 transition:
.hidden-content {
position: absolute;
opacity:0;
display:block;
transition: opacity 0.2s ease;
}
.wrapper:hover .hidden-content {
opacity:1;
}
Upvotes: 1