PDA

View Full Version : expanding/collapsing content box



bobvaz
03-26-2007, 07:20 PM
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.

thetestingsite
03-26-2007, 08:16 PM
Have you looked at this page:
http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm

Hope this helps.

bobvaz
03-27-2007, 02:34 PM
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.

thetestingsite
03-31-2007, 04:14 PM
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.

mburt
03-31-2007, 04:30 PM
I think he wants a dynamic overflow type option.
Like:

<input type="button" value="Expand" onclick="document.getElementsById([object]).style.overflow='visible';">

jscheuer1
03-31-2007, 07:00 PM
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.

bobvaz
04-06-2007, 12:33 AM
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.