Hey guys, been working on a jQuery code blurb that's a very simple show/hide system and I could use a bit of help. Clicking a button on the menu shows the graphic associated with that menu item while hiding the one previously visible. Example is here.
The code is pretty simple in general, here's the exciting part:
And then repeated for each image, showing and hiding the appropriate sections.
The issue I'm having is that if a button is clicked to show an image and then clicked again before another menu item is clicked, it hides that image without showing another.
Any suggestions on how to manage that second click so that the image isn't hidden? Thanks.
The code is pretty simple in general, here's the exciting part:
$(document).ready(function(){
$(".image01").show();
$(".showhide_image01").show();
$('.showhide_image01').click(function(){
$(".image01").fadeToggle();
$(".image02").hide();
$(".image03").hide();
$(".image04").hide();
$(".image05").hide();
});
$(".image02").hide();
$(".showhide_image02").show();
$('.showhide_image02').click(function(){
$(".image02").fadeToggle();
$(".image01").hide();
$(".image03").hide();
$(".image04").hide();
$(".image05").hide();
});
And then repeated for each image, showing and hiding the appropriate sections.
The issue I'm having is that if a button is clicked to show an image and then clicked again before another menu item is clicked, it hides that image without showing another.
Any suggestions on how to manage that second click so that the image isn't hidden? Thanks.