|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP + JavaScript + CSS
Hi there.
I'm making this fancy menu that uses a mix of XHTML, CSS & JavaScript and so far it works like a charm. I'm using CSS to hide or display sublevels of a list (ul/li etc) depending on user action. ie. they select a link, it shows the sublevels, they select it again it hides it and when they select the sublevel link it takes them to that particular page. Problem is, when you go to that page, the menu (naturally) resets, but the client wants the menu to stay open (or more specifically, reopen at that point) and I'm buggered if I can figure out how to do it. The menu is stored in a separate file and all the pages in the site will uses the PHP include to..well, include the menu, so I guess I'm looking for something that says "if your looking at page X display the sublevel on menu item X" Does any of that make sense? If not, go here (http://brad-lucas.org/dev/vent/index.htm) to see the menu in action and see the souce code I've used for it...it might explain it better than my worn out brain can. Hoping you can provide some advice or hints. Brad |
|
#2
|
|||
|
|||
|
RE: PHP + JavaScript + CSS
STARTALLOPEN=0
USETEXTLINKS=1 PERSERVESTATE=1 WRAPTEXT=1 USEFRAMES=0 IF U ARE USING JAVASCRIPT FOR THE MENU..CAN U ADD THESE LINES ON THE TOP OF THAT MENU..SPECUALLY "PERSERVESTATE=1" AND LET ME KNOW.. |
|
#3
|
|||
|
|||
|
RE: PHP + JavaScript + CSS
Those lines don't do anything...
This is the script that operates the menu, if it helps any: [highlight=php] function ShowStuff(id, anchor) { // If browser supports W3C DOM if (document.getElementById) { var elt = document.getElementById(id); if (elt.style.display != "block") { elt.style.display = "block"; } else { elt.style.display = "none"; } } //return false; if (anchor.href == '#') { return false; } else { return true; } } [highlight=php] |
|
#4
|
|||
|
|||
|
RE: PHP + JavaScript + CSS
(Sorry, despite using those [highlight=php] tags, the script is actually JavaScript)
|
|
#5
|
|||
|
|||
|
RE: PHP + JavaScript + CSS
please provide the menu..this is just the script that checks the browser support..can u provide the menu..here or send me the menu file to my yahoo id..
|
|
#6
|
|||||
|
|||||
|
RE: PHP + JavaScript + CSS
Here is the menu:
php Code:
|
|
#7
|
|||
|
|||
|
RE: PHP + JavaScript + CSS
heres what we use at http://wbn.lurkerlordx.com
Code:
<center>
<?
ini_set('display_errors',0);
echo "<a href='vampindex.php'>Welcome</a><BR><BR>";
//Thanks To PHP Freaks for the colapsing menu work
if ((isset($_SESSION['menu'])) && (!isset($_GET['menu']))) {
$menu = $_SESSION['menu'];
} elseif (isset($_GET['menu'])) {
if ($_SESSION['menu'] == $_GET['menu']) {
if ($_SESSION['expand'] == 0) {
$expand = 1;
} else {
$expand = 0;
}
} else {
$expand = 1;
}
$_SESSION['expand'] = $expand;
$tmenu = $_GET['menu'];
list($menu,$trash) = explode("?",$tmenu,2);
$_SESSION['menu'] = $menu;
}
$expand = $_SESSION['expand'];
list($earl,$trash) = explode("?",$_SERVER['REQUEST_URI'],2);
?>
<A CLASS="menu" HREF="<?php print($earl); ?>?menu=CharCreate">[OOC]Character Creation</A><BR>
<?php if (($_SESSION['menu'] == "CharCreate") && ($expand)) { ?>
<a href="chargen.php">Character Guidelines and Rules</a><BR>
<a href="bgrounds.php">Backgrounds</a><BR>
<a href="charsheet.php">Character Submission Form</a><BR>
<a href="meritflaw.php">Merits and Flaws</a><BR>
<a href="bannedmf.php">Banned Merits and Flaws</a><BR>
<a href="abilis.php">Abilities</a><BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=SectInfo">Sect Info</A><BR>
<?php if (($_SESSION['menu'] == "SectInfo") && ($expand)) { ?>
<a href="vamplexicon.php">Lexicon</a><BR>
<a href="LawsMasquerade.php">Laws of the Masquerade</a><BR>
<a href="SabbatInfo.php">The Sabbat</a><BR>
<a href="IndependentsInfo.php">The Independents</a><BR>
<a href="CamarillaInfo.php">The Camarilla</a><BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=Clans">Clans</A><BR>
<?php if (($_SESSION['menu'] == "Clans") && ($expand)) { ?>
<a href="Ravnos.php">Ravnos</a><BR>
<a href="setites.php">Followers of Set</a><BR>
<a href="Tzimisce.php">Tzimisce</a><BR>
<a href="Giovanni.php">Giovanni</a><BR>
<a href="Malkavian.php">Malkavian</a><BR>
<a href="Tremere.php">Tremere</a><BR>
<a href="Lasombra.php">Lasombra</a><BR>
<a href="Assamites.php">Assimates</a><BR>
<a href="Gangrel.php">Gangrel</a><BR>
<a href="Nosferatu.php">Nosferatu</a><BR>
<a href="Brujah.php">Brujah</a><BR>
<a href="Toreador.php">Toreador</a><BR>
<a href="Ventrue.php">Ventrue</a><BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=Disciplines">Disciplines</A><BR>
<?php if (($_SESSION['menu'] == "Disciplines") && ($expand)) { ?>
<a href="Protean.php">Protean</a><BR>
<a href="Presence.php">Presence</a><BR>
<a href="Potence.php">Potence</a><BR>
<a href="Obtenebration.php">Obtenebration</a><BR>
<a href="Obfuscate.php">Obfuscate</a><BR>
<a href="Fortitude.php">Fortitude</a><BR>
<a href="Dominate.php">Dominate</a><BR>
<a href="Dementation.php">Dementation</a><BR>
<a href="Chimerstry.php">Chimerstry</a><BR>
<a href="Celerity.php">Celerity</a><BR>
<a href="Auspex.php">Auspex</a><BR>
<a href="Animalism.php">Animalism</a><BR>
Quietus<BR>
Serpentis<BR>
Vicissitude<BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=Thaumaturgy">Thaumaturgy</A><BR>
<?php if (($_SESSION['menu'] == "Thaumaturgy") && ($expand)) { ?>
<a href="PathOfBlood.php">Path Of Blood</a><BR>
<a href="TheMovementoftheMindPath.php">The Movement of the Mind</a><BR>
<a href="TheLureofFlamesPath.php">The Lure of Flames</a><BR>
Alchemy<BR>
Biothaumaturgy<BR>
The Focused Mind<BR>
The Hearth Path<BR>
Mastery of the Mortal Shell<BR>
Technomancy<BR>
Oneiromancy<BR>
Path of the Blood's Curse<BR>
Path of Curses<BR>
Path of Transmutation<BR>
The Vine of Dionysus<BR>
The Faux Path<BR>
Thaumaturgy Rituals<BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=Necromancy">Necromancy/Voudoun Necromancy</A><BR>
<?php if (($_SESSION['menu'] == "Necromancy") && ($expand)) { ?>
The Sepulchre Path<BR>
The Bone Path<BR>
The Ash Path<BR>
Necromatic Rituals<BR>
Voudoun Rituals<BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=SetitePaths">Setite Paths</A><BR>
<?php if (($_SESSION['menu'] == "SetitePaths") && ($expand)) { ?>
The Snake Inside<BR>
Path of the Dry Nile<BR>
Setite Rituals<BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=AssamitePaths">Assamite Paths</A><BR>
<?php if (($_SESSION['menu'] == "AssamitePaths") && ($expand)) { ?>
The Hunter's Winds<BR>
Assamite Rituals<BR>
<?php } ?>
<BR><A CLASS="menu" HREF="<?php print($earl); ?>?menu=Koldunic">Koldunic Sorcery</A><BR>
<?php if (($_SESSION['menu'] == "Koldunic") && ($expand)) { ?>
The Way of Earth<BR>
The Way of Wind<BR>
The Way of Water<BR>
The Way of Fire<BR>
The Way of the Spirit<BR>
Koldunic Rituals<BR>
<?php } ?>
<BR>Links<BR>
<BR>Credits<BR>
</center>
<?php ini_set('display_errors',1);?>
thats our folding menu in the Kindred and Technocracy sections but you need to initilize it just once with... |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > PHP + JavaScript + CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|