Jump to content

jQuery show and hide

Craig Hopson

Recommended Posts

hi guys i cant get this working am i missing something simple?

<script src="js/jquery-1.7.2.min.js"></script><script type="text/javascript">$('.show-element', '.Item').hover(function() {	var container = $(this).attr("id").replace('show_', 'info_');	$('#' + container).show();}, function() {	var container = $(this).attr("id").replace('show_', 'info_');	$('#' + container).fadeOut(200);});</script><style>.hidden{	display: none;}</style><div class='Item'>	<div class='show-element' id='show_1'>Show</div>	<div id="info_1" class="hidden">some stuff</div>	<div class='show-element' id='show_2'>Show</div>	<div id="info_2" class="hidden">some stuff</div></div>

(does not show on hover)

Edited by Craig Hopson
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...