PDA

View Full Version : Switch Content Demo2 - Dynamic Content ?



sabahan
11-27-2007, 07:55 PM
1) Script Title: switch content script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem:

im using demo 2 with "content is hidden" as default
i did it by removing this line


joeexample.defaultExpanded(0,1)


my problem when i use this code..




<p id="joecontent1" class="switchgroup2">
<{foreach item=item from=$mydata}>
<table>
<tr>
<td>
<{include file="section.html" item=$item}>
</td>

</tr></table>
<{/foreach}>
</p>



- the content is open when loading..i need it to be hidden
- when i clicked open/closed/title nothing happen..it kept displaying

how do i make this work ?
what should i replace p with in the code below ?
i tried <table> and <td> it does not work


var joeexample=new switchcontent("switchgroup2", "p")

ddadmin
11-28-2007, 01:24 AM
What tag are you using to wrap each Switch Content? "DIV" works most reliably across browsers fyi.

I think a link to the problem page may be helpful here.

sabahan
11-28-2007, 04:07 AM
I changed it to "div" and it works thank you :)