Just to provide some more information on this.
To use more than one instance of this script you must make sure to have unique id's for each time the script is present.
I.E.
Code:
<h3 onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="sc1" class="switchcontent">
For menu 1 i would use id's something like this.
Code:
<h3 onClick="expandcontent(this, 'a1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="a1" class="switchcontent">
<h3 onClick="expandcontent(this, 'a2)" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="a2" class="switchcontent">
For menu 2 i would use id's something like this.
Code:
<h3 onClick="expandcontent(this, 'b1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="b1" class="switchcontent">
<h3 onClick="expandcontent(this, 'b2)" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="b2" class="switchcontent">
And for example, if you were to want to include a 3rd instance of the script. You could start the id's for menu 3 with c1, c2, c3...etc...
Hope that helped a little bit.
Bookmarks