What I am looking to do is the show() feature in jquery. In my PHP code, I have the code listing directories and each directory's link I want to have a specific link and a specific <div> tag under it. For instance:
[directory link]
[div tag]
The div tag's id will be the same as the directory name, so when I click the directory link "1" it will show the div "1" under the link. Does that make sense? Now, I know how to show/hide div's in jquery, but how do I call specific variables with it?
specifying variables with jquery
Array#3
Posted 21 March 2011 - 06:35 PM
I don't know what you mean by variables, but this could easily be accomplished by selecting the next sibling of the link (if there is literally nothing else between the two).
i.e.
p.s. Showing the exact markup would help us give other suggestions
i.e.
$('.directory').click(function (){ $(this).next().show(); });
p.s. Showing the exact markup would help us give other suggestions