Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 3rd, 2004, 08:24 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #2  
Old August 3rd, 2004, 11:39 AM
sourabh6526 sourabh6526 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Kolkata, WestBengal, India
Posts: 30 sourabh6526 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to sourabh6526 Send a message via AIM to sourabh6526 Send a message via Yahoo to sourabh6526
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..

Reply With Quote
  #3  
Old August 3rd, 2004, 09:02 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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]

Reply With Quote
  #4  
Old August 3rd, 2004, 09:03 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: PHP + JavaScript + CSS

(Sorry, despite using those [highlight=php] tags, the script is actually JavaScript)

Reply With Quote
  #5  
Old August 4th, 2004, 05:27 AM
sourabh6526 sourabh6526 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Kolkata, WestBengal, India
Posts: 30 sourabh6526 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to sourabh6526 Send a message via AIM to sourabh6526 Send a message via Yahoo to sourabh6526
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..

Reply With Quote
  #6  
Old August 4th, 2004, 10:16 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: PHP + JavaScript + CSS

Here is the menu:

php Code:
Original - php Code
  1.  
  2. <ul id="mitem0" class="links-list">
  3. <li><a href="index.php" onclick="return ShowStuff('mitem01', this)"><span id="menu-selected">home</span></a>
  4.     <ul id="mitem01" class="links-list">
  5.     <li><a href="#" onclick="return ShowStuff('mitem1', this)">Top Level</a>
  6.         <ul id="mitem1" class="links-list-hidden">
  7.         <li class="sub"><a href="#" onclick="return ShowStuff('mitem11', this)">Second Level</a>
  8.  
  9.             <ul id="mitem11" class="links-list-hidden">
  10.             <li class="sub2"><a href="#" onclick="return ShowStuff('mitem111', this)">Third Level</a>
  11.                 <ul id="mitem111" class="links-list-hidden">
  12.                 <li class="sub3"><a href="#">link</a></li>
  13.                 <li class="sub3"><a href="#">link</a></li>
  14.                 <li class="sub3"><a href="#">link</a></li>
  15.                 <li class="sub3"><a href="#">link</a></li>
  16.                 <li class="sub3"><a href="#">link</a></li>
  17.                 </ul>
  18.             </li>
  19.             </ul>
  20.         </li>
  21.     </li>
  22.     </ul>
  23. </li>
  24. </ul>

Reply With Quote
  #7  
Old August 5th, 2004, 07:00 PM
LLX LLX is online now
Contributing User
Click here for more information
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,131 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 55 m 34 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
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...

php Code:
Original - php Code
  1.  
  2. <?
  3.     session_start();
  4.     session_register('expand');
  5. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > PHP + JavaScript + CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT