Results 1 to 2 of 2

Thread: SwitchContent with Unordered HTML lists <UL> ??

  1. #1
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SwitchContent with Unordered HTML lists <UL> ??

    1) Script Title:
    Switch Content Script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem:

    I have an application (that unfortunately is not in production, so I can't send the webpage) that is using SwitchContent to display answers to questions. Everything works fine, unless the answer has an Unordered list in it. If the answer contains <UL> and <LI> tags, the UL and LI portions of the answer do NOT contract. ANyone else have problems with UL???

    The relevant code:

    <A href="javascript:togglehideshow.sweepToggle('contract')">Contract All</A> | <A href="javascript:togglehideshow.sweepToggle('expand')">Expand All</A> </div>


    <p class=switchgroup1 id=bobcontent<%=x%>><%=Answer%>

    <SCRIPT type=text/javascript>
    var togglehideshow=new switchcontent("switchgroup1", "p")
    togglehideshow.setStatus('<img src="../images/site/Eopen.gif" /> ', '<img src="../images/site/bdot.gif" /> ')
    togglehideshow.setColor('darkred', '#607DA7')
    togglehideshow.setPersist(true)
    togglehideshow.collapsePrevious(true)
    togglehideshow.init()
    </SCRIPT>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It shouldn't matter if the expanding content contains UL lists, as long as they are wrapped in the main content DIV. I just tested this out, and the below seems to work fine:

    Code:
    <h3 id="bobcontent2-title" class="handcursor">Difference betwen Java & JavaScript?</h3>
    <div id="bobcontent2" class="switchgroup1">
    Java is completely different from JavaScript.
    The former is a compiled language while the later is a scripting language.
    <ul>
    <li>sdff</li>
    <li>sdff</li>
    <li>sdff</li>
    <li>sdff</li>
    </ul>
    </div>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •