Friday, 15 August 2014

How to select a child in jquery? -



How to select a child in jquery? -

this sample structure!

<div id ="div1"> <div class="div1-child"> <div class="div1-sub-child"> </div> </div> </div>

can help me how apply jquery effects on div1-sub-child when hover div1?

try

$("#div1").hover( function() { $(this).find('div.div1-sub-child').filter(':not(:animated)').animate( { marginleft:'9px' },'slow'); }, function() { $(this).find('div.div1-sub-child').animate( { marginleft:'0px' },'slow'); });

hover has 2 callbacks 1 fire when hover , sec fire when hoverout.

jquery

No comments:

Post a Comment