I suspect this is extraordinarily simple,  but I've yet to find a way
to do it so bear with me (very new to jquery).

My mission is to allow a user to click on a link of css class
"closed" (the content below that point in the DOM will be hidden).
When that link is clicked the content will .show(), or
maybe .toggle().

My first issue is that there may be several links of the class
"closed" on the page.  I need to select only the DOM content "below"
that link -- ie, everything (I think) from the link up to the </body>
tag.  So I need to know which link was clicked (the links will NOT
have IDs -- neither will anything else in the DOM).  How do I say with
jquery, "select everything from the link that was clicked through the
end of the document"?

My next issue (which I can tackle after my first problem is resolved),
is that I will need to loop through the returned object, toggling open
or closed, until I reach the next instance of an h tag (actually,
either h3 or h4). At that point I'll bail out of the loop.

So the effect is pretty simple:  When the user hits the page, there
are a bunch of "closed" sections.  By clicking the link the user
"opens" one or more of those individual sections.  What makes it
difficult is that fact that I need to enable some non-html-savvy
person to add new content through an admin (CMS) interface, and have
that person be able to add the code to necessary to do the open/close
routine.  I think I can do all this with jquery, and all the admin
user would need to do is add the "closed" class to the link. Does that
make sense?

All help appreciated.

jp

Reply via email to