How to add a hide toggle script to your article

by Paul Emerson Leicht jan/2010

First of all the code presented here must be put into the article using the html editor not the rich text editor. Switch to the html editor via the link below the article text box. Next copy the text in the code box below into the top most portion of your article. Then add in the div boxes where needed and the links to them just above. Everything inside the div tags should be invisible to start and become visible when the associated link is clicked.

Code Box below:

Instructions: copy and past the above code into your document. Then you will need to be able to use it. Each place you want to hide something you will need to surround with <div> tags (both open and close too: </div>)


Sample html:

Below is a sample of the way the code should work. Click on the click me link to hide/show the section with the text in it.

Notice that the element id must match the variable elemId in the function so in this example the id is 'first_el' and that is what we put in toggleHideShow...

sample area:
click me