I’ve looked around on the Stack for an answer that I could apply, but I’m not great with javascript.
I’ve got a list of links that need to show a hidden div. Easy enough. But there are about 8 of these links and the divs have to occupy the same space. Therefore, when you click on Link 1 (Link 1’s div appears), and you then click on Link 2, I need Link 1’s div to disappear and Link 2’s div to appear.
Currently, I’m using jQuery’s toggle function to get the effect I’m looking for, but you have to click the link twice to hide the info again.
Any ideas would be greatly appreciated!
Without having any syntax to work with, you should be able to use something like the following:
To Hide the links themselves:
likewise, if you wanted to use divs: (using the included HTML below)
Working Demo