
Hover Div System
By: a guest on Feb 23rd, 2012 | syntax:
None | size: 0.85 KB | hits: 13 | expires: Never
$(".container").hover(function() {
$(this).find(".hover").fadeIn();
}, function() {
$(this).find(".hover").fadeOut();
});
<div class="container">
<div class="hover">
Content Here
</div>
<a href="#">Link</a>
</div>
.container, .hover { width: 100px; height: 300px; background: white; }
.hover { position: absolute; display: none; }
<div id="container">
<a href="#" id="link">Link</a>
<div id="divtofadein">some content here</div>
</div>
$(function(){
$("#divtofadein").mouseout(function(){
$(this).fadeOut();
})
.hide();
$("#link").click(function(){
$("#divtofadein").fadeIn();
});
});
#container {
position: relative;
width: 100px;
height: 200px;
}
#link {
position: absolute;
top: 0px;
left: 0px;
}
#divtofadein {
position: absolute;
top: 0px;
left: 0px;
width: 100px;
height: 200px;
background: #FFF;
}