Well, if all you need is the link to contract/expand the div beneath it when clicked on, that's very simple. But I gather the reason you wish to use something like Switch Content script is for the added features like persistence, contract all/expand all? It's actually quite easy integrating the two scripts together. Install both scripts on your page, then for the code of Step 2 for Switch Content script, each switch content looks something like this:
Code:
<h3 onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="sc1" class="switchcontent">
DIV TEXT HERE
</div>
Change that to:
Code:
<h3 onClick="expandcontent(this, 'commentarea1'); ajaxpage('comments.php?bid=5&cid=1', 'commentarea1');" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</h3>
<div id="commentarea1" class="switchcontent">
DIV TEXT HERE
</div>
The changes are in red. I haven't test run this, but the basic idea should definitely work.
Bookmarks