Code: Select all
{literal}
<__script__ type="text/JavaScript">
<!--
// TO COLLAPSE/EXPAND ELEMENT
function expand(ind)
{
e = document.getElementById("ex_"+ ind);
if (e.style.display == 'none')
{
e.style.display = 'block';
}
else if (e.style.display == 'block')
{
e.style.display = 'none';
}
}
//-->
</__script>
{/literal}
{foreach from=$items item=entry}
<div class="QandA-Question">
<a href="javascript:expand({$entry->id})">{$entry->question}</a>
</div>
<div id="ex_{$entry->id}" style="display:none" class="QandA-Answer">
{if $entry->answer}{$entry->answer}
{else}<p>Question to be answered soon.</p>
{/if}
</div>
<p class="QandA-RecordDetails">Category: {$param_category} | Question from {$entry->author} on {$entry->created|date_format}</p>
{/foreach}
http://forum.cmsmadesimple.org/index.php/topic,16483.msg81626.html#msg81626
michel