PDA

View Full Version : Switch Content persist problem



chazzer
10-15-2004, 08:17 AM
Script: Switch Content

I'm having trouble with the "Switch Content" script:
http://dynamicdrive.com/dynamicindex17/switchcontent.htm

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:
var collapseprevious="no"
The 'enablepersist' works.

Ideally I would prefer to have both functions working.

Any ideas anybody?

ddadmin
10-18-2004, 08:22 PM
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?

chazzer
10-19-2004, 04:06 AM
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.

ddadmin
10-20-2004, 08:06 PM
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.

BradF
11-18-2004, 06:24 PM
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:
http://www.BradBlog.com