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

http://jsfiddle.net/zidski/4hh9j/1/

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

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -