The code below is working, but with a problem I do not understand.
When I click on first navigation link it is showing the div, this is what I want,
but when I click on another nav link it does show the next div as expected
but I need for the previous div(s) to hide.
any help is appreciated.
something like: if this is not the nav link that was clicked hide. I would think.
$(document).ready(function(){
$('#navigation a').click(function (selected) {
var getName = $(this).attr("id");
var projectImages = $(this).attr("name");
//console.log(getName);
//console.log(projectImages);
$(function() {
$("#" + projectImages ).show("normal");
});
});
});
You could try adding a class to the div you are showing, and then hiding elements with that class when you show the new div(s). Something like this: