jquery - Why is `$(this).children` not working in the following code? -
why $(this).children not working in following code?
$('.home-box').hover(function() { $(this).children('home-box-caption a').animate({ bottom: -12, }, 200); }, function(){ $(this).children('home-box-caption a').animate({ bottom: -24, }, 200); }); 
.home-box { background: url(images/home_box_bg.png) no-repeat 0 0; cursor: pointer; float: left; margin: 25px 13px 25px 0; position: relative; width: 230px; height: 160px; } when hover .home.box nothing happens.
in selector use children() function, forgot add dot character (.) indicate class name home-box-caption.
the selector should
$(this).children('.home-box-caption a').animate(...); //----------------^
Comments
Post a Comment