Jquery hover get Id issue -


hi have img , when hover on want unhide div, won't work. here attempt.

     $("img").hover(           function () {           var currentid = $(this).attr('id');           $('.'+currentid).show();       },           function () {           var currentid = $(this).attr('id');           $('.'+currentid).hide();       }      ); 

here html

     //intially hidden via display:none       <div class="alligator sinensis" style="display:none;border:solid;float:right;">       //this image             <img id="alligator sinensis" class="circular resultss imgs" src="http://media.eol.org/content/2013/02/20/13/27869_orig.jpg"> 

your id , class can't have spaces.

<div class="alligatorsinensis" style="display:none;border:solid;float:right;">   //this image        <img id="alligatorsinensis" class="circular resultss imgs" src="http://media.eol.org/content/2013/02/20/13/27869_orig.jpg"> 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -