jquery - how do you add multiple hover on classes -
i want following hover on function work on individual panels
jquery
$(".wrap").each(function () { $(this).hover(function () { $(".panel").slidetoggle("fast"); }); }); demo here
the problem selector $(".panel"), selects elements class panel need panel element in hovered .wrap element
also .each() loop not needed
try
$(".wrap").hover(function () { $(this).find(".panel").slidetoggle("fast"); }); demo: fiddle
Comments
Post a Comment