I’m a little (more like a very) rusty on my jquery knowledge. for some reason I can’t figure out what I am missing here to make the blue box fade when the green box is being hovered over.
the script:
$(document).ready(function() {
$(".hover-text").hover({
$(".hover-hide").animate({
opacity: 0.4,
}, 500);
});
the html:
<div class="hover-hide">
<div class="hover-text">
BLAH
</div>
</div>
the css:
.hover-hide{
width:200px;
height:200px;
background-color:blue;
padding:30px;
}
.hover-text{
color:white;
background-color:green;
padding:10px;
width:auto;
margin-top:20px;
}
Thanks so much! 🙂
The first argument of
.hoveris a callback function, it should be$('.hover-text').hover(function(){.Fiddle here.