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 !
Use CSS3 transition:
.hidden-content {
position: absolute;
opacity:0;
display:block;
transition: opacity 0.2s ease;
}
.wrapper:hover .hidden-content {
opacity:1;
}
I have made some changes to your code. This should work. I added this line among other things:
$(this).children(".hidden-content").fadeIn('slow');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.