PDA

View Full Version : Switch Content Script



arthurpwiggle
03-04-2005, 02:50 AM
Script: Switch Content
http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

I am using a server side include with this script to produce menus across our website. I would like to make the menu persistent "statewide" that is, when someone opens another page on our site, I would like it to remember what trees were open on the last page an display them in the same manner, rather than it closing down to the original format. You can see the menu we are using currently at: www.mercwars.com (http://www.mercwars.com) .

Thanks.

arthurpwiggle
03-04-2005, 04:05 PM
Actually, I found the Switch Menu script does what I want. So, new question.

Script: Switch Menu
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

I think this might be a better script to get the menus to persist across the site, and they look like I want them to look. Does anyone know how I can add the "+" symbol infront of the menu headers when they're closed and the "-" symbol in front of them when they're open?

Oh, and I'm using an SSI for the menu, I don't know if that affects it or not.

If you're not sure what I'm talking about, you can see the partially complete new menu at www.mercwars.com/stupid/testmenu.htm (http://www.mercwars.com/stupid/testmenu.htm) .

amvmendoza
03-08-2005, 05:52 PM
I tried using this script as is and it works. However, when i create <ul><li> tags within the span tags so i can control the formatting of the listed items, the menus close back to its original state. Can someone help with this problem? Thank you much.

Minos
03-08-2005, 08:11 PM
arthur, There are really only two ways I can think of, and one might be unrealistic. The easiest is to create 2 small images of a plus and minus. Stick the plus image in front of all the Links, and when the style property is changed to block, change the image src to the minus.

The other is putting a text-box in front of the links. Make it locked (so user can't edit it), and make the background transparent. Then same as above, just change the value of the box. The advantage is that you won't have images. The problem is that it's more code, and I'm not sure how easily it can be done.

amv, try using CSS for all formatting, it's easier, and you can get the same effect. Here's how:


.submenu a:link{
display:list-item;
list-style:circle;
}


Add that beneath .submenu, remove all <br>'s from behind the </a>'s, and try that.

amvmendoza
03-09-2005, 12:24 AM
Thanks for the quick reply:) However, the css you had provide for me did not display them as list-items. They just seem to sit on the same line. Is there additional code i should include there within the CSS?

On the up site, the menu remained opened and did not collapse to is original format :)

amvmendoza
03-09-2005, 12:31 AM
I just found out that when i refreshed my browser and delete the cookies, it did list the items but when i clicked on the other pages, it did not recall to list them again. I have left the css embedded in each page for testing. Could there be something in the Javascript perhaps that needs to also be adjusted? Thanks again.

ddadmin
03-09-2005, 09:43 PM
Hmm I'm a little confused what have already been resolved and the question that remains. Are you basically asking how to persist the state of Switch Content across multiple pages, as seen in Switch Menu script?