Results 1 to 7 of 7

Thread: expanding/collapsing content box

  1. #1
    Join Date
    Aug 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default expanding/collapsing content box

    I have searched many sites but have not found quite the tweek I would like to do. I would like to display 4-5 boxes in a side bar which display the contents of files. For each box (table), I would like to display the first five lines in the file, and then via a [+], display the remaining lines in the expanding box. Then clicking on a [-] would return the box to the original 5 lines. Anyone know of a site, tutorial where I might find this. Thanks.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Have you looked at this page:
    http://www.dynamicdrive.com/dynamici...chcontent2.htm

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Aug 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Absolutely perfect! Thank you testing site. But, I would like to show the first five lines and then display the expand option. Do you or anyone know how to limit the first display to a particular number of lines? Thanks Again.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Sorry for the late response, I didn't see that you had responded after my last post. Anyways, what do you mean by this:

    I would like to show the first five lines and then display the expand option.
    Do you mean something like a comments system (on many review websites), to where the first 5 comments are displayed, and there is a link that says "Show More"? If not, could you elaborate more on this and I will see if I can help you any more.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I think he wants a dynamic overflow type option.
    Like:
    Code:
    <input type="button" value="Expand" onclick="document.getElementsById([object]).style.overflow='visible';">
    - Mike

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think maybe something like this:

    Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
    Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
    Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
    Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
    Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah [More]

    Is that what you had in mind? If so, just have the [More] be the trigger to expand that story's (or whatever it is) other content.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Aug 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks to jscheur1, mburt, and the testing site for your responses...I went out of town and was just able to respond. To explain what I would like I will use dynamic drive's chcontent2 as the example. The script is in php and the content I display is from server side files. If there are five lines or less, I display the div or table without the icon of (+ or -). When there are more than five lines, instead of a + I would like to display 'more...' and use this like mburts' example by selecting it and displaying the remaining text. But, when the 'more....' is selected, overlay the other tables with the additional text and then display a 'close' option in the header where the 'more' was before and return to the original 5 line display. Hope that makes sense. Thanks for your help.

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
  •