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
Started by
derek.sullivan
, Mar 21 2011 01:04 PM
2 replies to this topic
#1
Posted 21 March 2011 - 01:04 PM
#2
Posted 21 March 2011 - 03:21 PM
The directory name would also be "1"
#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
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users