jquery - How to show a hidden div on mouse over on a series of images -


i have series of images have description div hidden. i'm trying show description on hover event. can't see work. here's code.

<div class="peopleimage" id="image1">     <img src="image1.jpg">     <div class="peopleinfo">description goes here</div> </div>   <div class="peopleimage" id="image1">     <img src="image1.jpg">     <div class="peopleinfo">description goes here</div> </div>  <div class="peopleimage" id="image1">     <img src="image1.jpg">     <div class="peopleinfo">description goes here</div> </div> 

here's jquery i'm working with:

$(".peopleimage").hover(function () {     var peopleinfo = $(this).closest('.peopleinfo');     peopleinfo.show(); }); 

nothing seems happen. suggestions appreciated!

try this:

$(".peopleimage").hover(function () {    $('.peopleinfo', this).show(); }, function() {    $('.peopleinfo', this).hide(); }); 

jsfiddle example


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -