Results 1 to 4 of 4

Thread: collpase expand using just one button

  1. #1
    Join Date
    Oct 2007
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default collpase expand using just one button

    1) Script Title: Switch Content

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

    3) Describe problem: no problem. would like to have the collapse/expand rendered into just one button please

    hi im looking at the code. i get lost when trying to figure out how or when to set the user's first action, so every time they click the col/exp button the function executes accordingly (if var==expanded, then collapse) you get the idea

    would really appretiate if yet, another tweak i ask would be complied
    Last edited by ricmetal; 04-12-2009 at 11:02 PM.

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

    Default

    Well, by default clicking on each of the headers will either collapse or expand its corresponding content depending on the later's state already. Are you talking about the ability to toggle a header using some arbitrary link on the page?
    DD Admin

  3. #3
    Join Date
    Oct 2007
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    hi
    no, im talking about only having one button to toggle the contract/expand of all divs. just like the default for each header, but applied to the contract all / expand all buttons. so instead of two buttons to toggle expand/contract on all divs, just one
    Last edited by ricmetal; 04-13-2009 at 11:52 PM.

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

    Default

    Sure, try the below modified .js file, which lets you add a link such as the below to toggle the states of all the contents similar to Collapse All and Contract All:

    Code:
    <a href="javascript:bobexample.sweepToggle('toggle')">Toggle All</a>
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    ricmetal (04-14-2009)

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
  •