SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict capescafe's Avatar
    Join Date
    Dec 2004
    Location
    Bellevue, WA
    Posts
    222
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Expand/Collapse menu or block of text

    Hi all,
    I searched these forums and found similar solutions but nothing that quite works for what I'm trying to do. The closest thing I found is here: http://www.dustindiaz.com/dhtml-expa...apse-div-menu/

    Here's an explanation of what I'd like to do. I have a page of "Archives" which is getting to be quite long and hard to find things. So I'd like to have the main title of each archive listed and each title would be expandable. So when you first load the page you'd see:

    Archive 1
    Archive 2
    Archive 3
    etc.

    But then you could click on for example Archive 1 and it would expand to look like:

    Archive 1
    sublink
    sublink
    sublink
    sublink
    Archive 2
    Archive 3
    etc.

    That example from that page that I listed above seems to work, accept that I need multiple divs. Does that mean I have to create a new div id for every single archive section? That would be way too many and I'd have to keep adding one every month when I archive a new item.

    Does anyone have an easier solution? I'd like just a simple javascript that can do this. But I can't seem to find anything that fits what I'm trying to do.

    Thanks for any help.
    Carolyn (cape's cafe)
    Twitter | My Treehouse Profile | eBookFling

  2. #2
    SitePoint Zealot alfred3x's Avatar
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you want an accordion. There's one in scriptaculous I believe.

    As for adding a section each month, unless you have some other code to handle database data, you probably *will* have to do it manually each month.

    - AAA
    - A. Alfred Ayache
    PHP/MySQL ZCE

  3. #3
    SitePoint Addict michael - ohio's Avatar
    Join Date
    Dec 2004
    Location
    ohio
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may be able to use this:
    http://www.dynamicdrive.com/dynamici...dependency.htm

    The demo (expanding choices for a hosting signup form) shows it expanding form choices such that the original hidden state is:

    CHOOSE: A B C

    and when you choose "A" it changes to

    CHOOSE A B C
    1 2 3 4

    or when you choose "B" it changes to
    CHOOSE A B C
    5 6 7 8
    etc...



    Quote Originally Posted by capescafe View Post
    I have a page of "Archives" which is getting to be quite long and hard to find things. So I'd like to have the main title of each archive listed and each title would be expandable. So when you first load the page you'd see:

    Archive 1
    Archive 2
    Archive 3
    etc.

    But then you could click on for example Archive 1 and it would expand to look like:

    Archive 1
    sublink
    sublink
    sublink
    sublink
    Archive 2
    Archive 3
    etc.

  4. #4
    SitePoint Addict michael - ohio's Avatar
    Join Date
    Dec 2004
    Location
    ohio
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    content expand/collapse script

    this one may suit your needs better:
    http://www.dynamicdrive.com/dynamici...tchcontent.htm


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
  •