Switch Content persist problem
Script: Switch Content
I'm having trouble with the "Switch Content" script:
I have used: var enablepersist="on"
But this does not work consistently. Somtimes it remembers which menu was open and sometimes it doesn't.
Here is a brief explanation of how I have implemented this script.
I have a number of web pages built using ASP for a shopping cart site. I have set up the menu on an included ASP page so that it can be shared by all the pages in my site. I have then populated the menu headers and submenu items from a database recordset. This all works well.
The problem is that as you navigate around the site then menus close up and open randomly.
However, if I then change the 'collapseprevious' off:
The 'enablepersist' works.
Ideally I would prefer to have both functions working.
Any ideas anybody?
Last edited by chazzer; 10-15-2004 at 09:25 AM.
Just to clarify, the persist feature for this script works on a per page basis, meaning the same script on different pages each contain their own persist settings. Are you looking to get the script to persist across multiple pages using the same setting?
Yes, I am hoping to get the script to persist across multiple pages. I did not realise that this feature was on a per page basis. Not only am I using the same setting but I'm also using the same file as the menu is in an include file that is shared by all the pages.
Ok, attached is "switch.zip", a modified version of the script that should in theory persist across the entire site rather than on a per page basis. I haven't fully tested it, though logically I don't see why it wouldn't work.
Another Switch Content Problem/Question
Currently, when I have this script in use, the page I am using it on will freeze/hang for a number of seconds (longer on pages that have *alot* of content). Any idea what might be doing that in your script?
When I remove the script entirely, the freeze/hang goes away, so I've been able to isolate it to this script.
One page I use it on has *alot* of content, so the hang is particularly long (can be up to 20 seconds depending on speed of computer).
HELP, please! :-)
You can check this in action at: