Hi,
I'm trying to implement the code for the "Switch Content Script IE" found at:
http://www.dynamicdrive.com/dynamici...tchcontent.htm
It all works perfectly until I try to add a New Expandable item. I'm no good with Javascript so I'm pulling my hair trying to figure out why I can't get more than the default 3 items to show up.
Heres the default code:
All I want to do is add another one (actually several) like:Code:<body> <h3 onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3> <div id="sc1" class="switchcontent"> JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer. </div> <h3 onClick="expandcontent(this, 'sc2')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>Difference betwen Java & JavaScript?</h3> <div id="sc2" class="switchcontent"> Java is completely different from JavaScript- the former is a compiled language while the later is a scripting language. </div> <h3 onClick="expandcontent(this, 'sc3')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is DHTML?</h3> <div id="sc3" class="switchcontent"> DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience. </div>
I thought that all I would need to do was change the ID (i.e., SC3, SC4, etc..) to make it work but it doesn't. Any ideas? ThanksCode:<h3 onClick="expandcontent(this, 'sc4)" style="cursor:hand; cursor:pointer"><span class="showstate"></span>Item Number 4 </h3> <div id="sc4 class="switchcontent"> This is a Test </div> </body>
I'm not able to point you to my page as it's on a non-internet connected network.
Bill



Reply With Quote
Bookmarks