It seems that two things do not work with this code .
- I want to be able to hover over a large DIV to display a smaller size.
In its current form, it only works if you hover over the smaller DIV. 2. The smaller DIV does not disappear when I stop hanging.
<div class="one"> <div class="two"></div> </div> <div class="one"> <div class="two"></div> </div>
.one { position: relative; width: 100px; height: 100px; margin: 10px; background-color: #CCC; } .two { position: relative; top: 20px; left: 20px; height: 40px; width: 40px; background: #333; }
$(function(){ $(".two").css("opacity",0).fadeTo(0, 0); $(".two").mouseover(function () { $(this).fadeTo(200, 1); }); $("two").mouseout(function () { $(this).fadeTo(200, 0); }); });
source share