Page 1 of 1

PHP Cookie (expand collapse)

Posted: Sat Jun 25, 2011 11:03 pm
by Pazuzu156
I'm using modules in the site I'm building, and allowing them to be either expanded to collapsed to save space. What's a good way to have this happen, collapse the module, change the collapse icon to the expand icon, and store a cookie to keep the module collapsed until the user manually expands it?

Code: Select all

<div id="modules">
<div id="members" class="mod">
<div class="module">
<div class="moduleTop">
<div class="moduleTitle">Members Area</div><div class="collapse"></div>
</div>
<div class="moduleContent">This is the module's Content</div>
</div>
</div>
<div id="june" class="mod">
<div class="module">
<div class="moduleTop">
<div class="moduleTitle">June</div><div class="collapse"></div>
</div>
<div class="moduleContent">This is the module's Content</div>
</div>
</div>
</div>
</div>
To see what I'm talking about, here is a link to a dummy design, with the modules on the right which do nothing right now. http://www.kalebklein.com/projects/SYS/

Re: PHP Cookie (expand collapse)

Posted: Mon Jun 27, 2011 1:17 am
by phazorRise
you can do it with javascript.

here's the link : http://www.dynamicdrive.com/dynamicinde ... llapse.htm

Re: PHP Cookie (expand collapse)

Posted: Tue Jun 28, 2011 7:13 pm
by Pazuzu156
That works. Here is an excellent example of what I was trying to achieve. http://forums.warpportal.com/