• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Collapsible Menus + Cookie settings

Electronic Punk

willalwaysbewithyou
Staff member
Political User
#2
Was very pleased and was looking at a way of integrating it into our headline block having told Neobond and Redmak that I loved it and was going to have to steal the idea. (gave em more to compensate)

Put it in my makeshift test theme:
http://www.osnn.net/index.php?&themeid=3

(also had some other work done it on, been cleaning up the menus and changing a few things before I push it out to the other themes - clearing things up for some reason)

You can see the script in action at the top, but sadly for some reason it is
a) collapsed by default (bad)
b) doesn't save across sessions so remains collapsed.

This is the most suitable script I could find and I have been looking for a while.

Any cookie pro's why is this not working?

Collapse bit isn't final by the way, I just wanted to get it working.
 

SPeedY_B

I may actually be insane.
#3
It's not remaining open/closed because no cookie is being set. ;)

And it's default to closed because of this
Code:
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{[b]display:none;[/b]}')
document.write('</style>')
}
which, to me at least, seems a nasty way of doing it anyway.
 

SPeedY_B

I may actually be insane.
#10
LordOfLA said:
Except it dont work in firefox 1.5.0.1 (dont ask - i keep asking for .3 to be rolled out across active directory...)
Works fine in 1.5.0.3, and I doubt there were any major changes in the javascript engine between the two versions.

You sure you have JS enabled?
 

SPeedY_B

I may actually be insane.
#12
cookified :p

Works for me in WebKit, Gecko and Opera (Can't test IE ;P).

The cookie could be a bit more refined, rather than setting it to a date in May 2100, but for simplicities sake, that's how I've done it in the example :D
 

SPeedY_B

I may actually be insane.
#14
That seems to be a rather large script for such simple functionality.

Have changed it to only one link is showing now. Niff. :)
 

Electronic Punk

willalwaysbewithyou
Staff member
Political User
#15
Oooh spangley.
Any idea why its not working on the frontpage?

Trying to put them in a .js if I can which is called in the header tag, could be the problem.
 

SPeedY_B

I may actually be insane.
#16
Yup, due to the way it interacts, the JS needs to be in the body, below the div/item we're collapsing. You can still call it via a .js, but it just needs to be below. :)
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies