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); });  

enter image description here

.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

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -