[jQuery] Show all?
[jQuery] Show all?
What I am looking for is a way to hide the last one of these that was clicked. I tried saving the object that was last used in a var but that didnt work. I thought then maybe I could create some kind of "close all" that would close all the other layers but not the one we have clicked to show.
<span style="font-family: courier new,monospace;">$('#Location').click(function() { </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $("#attrname").css('background-color','#8FA9C5');
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $("#attrtext").text("Location"); </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $("#location").show(); </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $("#shape").hide();
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> });</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $('#Shape').click(function() { </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
$("#attrname").css('background-color','#8FA9C5')</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $("#attrtext").text("Shape");
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $("#location").hide(); /* should hide location */</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $("#shape").show();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> });</span>