Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Client-side Scripting _ Producing a nested collapsible list for a sidebar

Posted by: Melinda Mar 7 2012, 11:29 AM

Hi,

Could I get some assistance with producing code for a collapsible list please?

Ive fond some tags/ code but I dont know what the ahref should refer to.

CODE
<ul id="someID">
  <li>The January Garden
    <ul><a href="java script:cl_expcol('ex3');">[+]</a>
      <li><a href="someHref">The lawn</a></li>
      <li><a href="someHref">The Greenhouse</a></li>
      <li><a href="someHref">Vegetables</a></li>
      <li><a href="someHref">FRuit</a></li>
    </ul>
  </li>

Posted by: pandy Mar 7 2012, 11:48 AM

The URL to the page you want the link to lead to.
http://htmlhelp.com/faq/html/links.html#link-howto


Posted by: Melinda Mar 7 2012, 12:24 PM

Cheers for that Pandy! biggrin.gif


About the nesting code- do I need to add that bit of java script at the top to make the list collapse, or can I do without it?

CODE
<ul id="The Gardening Month">
<li><a href="java script:notA();"><p><strong>The January Garden</strong></p></a></li>
    <li>
    <ul>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Vegetable Garden</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Flower Garden</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Fruit Garden</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Greenhouse</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Lawn</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">The Armchair</a></li>
      <li><a href="http://lewishamgardens.webs.com/the-gardening-month">Other Jobs</a></li>
      </ul><p> </p>

Posted by: Melinda Mar 7 2012, 12:55 PM

Sorry for not explaining more clearly.

I would like a list of the months of the year with a nested list of gardening activities inside.

When the activity is clicked, it should link to that activity in the specific month.

But I dont want the activities to be visible all the time- hence the need for it to be collapsible

Posted by: pandy Mar 7 2012, 06:55 PM

If something should happen when something is clicked you need JavaScript. It's easy to find examples.

http://www.google.com/search?q=collapsable%20list%20css

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)