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
Post a Comment