PHP Cookie (expand collapse)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Pazuzu156
Forum Contributor
Posts: 241
Joined: Sat Nov 20, 2010 9:00 pm
Location: GA, USA
Contact:

PHP Cookie (expand collapse)

Post 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/
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: PHP Cookie (expand collapse)

Post by phazorRise »

you can do it with javascript.

here's the link : http://www.dynamicdrive.com/dynamicinde ... llapse.htm
User avatar
Pazuzu156
Forum Contributor
Posts: 241
Joined: Sat Nov 20, 2010 9:00 pm
Location: GA, USA
Contact:

Re: PHP Cookie (expand collapse)

Post by Pazuzu156 »

That works. Here is an excellent example of what I was trying to achieve. http://forums.warpportal.com/
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
Post Reply