Forum Moderators: open

Message Too Old, No Replies

Navbar onDown event AFTER php reload

PHP framework, Navbar with down state HELP!

         

Kappatango

9:13 pm on May 19, 2008 (gmt 0)

10+ Year Member



Hi,

I have created a Navbar and want to have a down state to help the user recognise the section of the site they are on....

I use a PHP framework which calls the pages to construct, populating the .location. $ <pagename> with the relevant content.

This page reload causes the navbar to reset so does not remember the down state.

Is there some java that can set [a cookie] to remember the correct downsatte for the button when the page re-constructs?

Thanks

Karl

Page Construction code:


<title>Welcome To bigEyeWorld.co.uk</title>

<?php

//Variable Setup
$location = $_GET['location'];
if (!isset($location)) { $location = 'Home'; }

//Build Page
include ("includes/header.php");
include ("includes/menu.php");
include ("content/".$location.".php");
include ("includes/footer.php");
?>

And an example of one button:


<a href="index.php" target="_top" onclick="MM_nbGroup('down','group1','Start','../Images/newsite/buttonimages/startover3.jpg',1);" onmouseover="MM_nbGroup('over','Start','../Images/newsite/buttonimages/startover3.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="../Images/newsite/buttonimages/start3.jpg" alt="Start" name="Start" border="0" id="Start" onload="" /></a>

FiRe

9:29 pm on May 19, 2008 (gmt 0)

10+ Year Member




<?php if ($location == 'Home') { ?>
Down code here
<?php } else { ?>
Up code here
<?php } ?>

?

Kappatango

9:41 pm on May 19, 2008 (gmt 0)

10+ Year Member



Thanks for the reply so quickly, but I am still slightly confused.

How does that code work for multiple buttons? I have 7 buttons in total....

Also, what is the format of the code for the "down code here"...... how do I define where the image is displayed?

I am quite new to coding - tend to find and manipulate in order to learn.....

Thanks Again

Kappatango

10:50 pm on May 19, 2008 (gmt 0)

10+ Year Member



UPDATE:

I am Now using some Javascript in the body of the "content" (.location.) page to set the Down state "onload"....

"MM_nbGroup('over','Accessories','../Images/newsite/buttonimages/accessbutover.jpg','',1)"

This works to set the image, however, when you rollover then move off, the updstate is displayed.

The menu java control is in its own "Includes" .... is there a Java command to avoid the revert to upstate after the successful onload "downstate" is rolledover?

[edited by: Kappatango at 10:50 pm (utc) on May 19, 2008]

Kappatango

3:58 pm on May 23, 2008 (gmt 0)

10+ Year Member



OK, this is now resolved thanks to co-operation on a different forum
FYI, here's the code:


<script type="text/javascript">
<!--
<?php
echo "var loc = '$location';";
?>
if(loc == "Home"){
MM_nbGroup('down','group1','Start','/Images/newsite/buttonimages/startover3.jpg',1);
}else if(loc == "Funky"){
MM_nbGroup('down','group1','Funky','/Images/newsite/buttonimages/funtoybutover.jpg',1);
}else if(loc == "Classic"){
MM_nbGroup('down','group1','classic','/Images/newsite/buttonimages/classtoybutover.jpg',1);
}else if(loc == "Clothes"){
MM_nbGroup('down','group1','clothes','/Images/newsite/buttonimages/clothesbutover.jpg',1);
}else if(loc == "Accessories"){
MM_nbGroup('down','group1','Accessories','/Images/newsite/buttonimages/accessbutover.jpg',1);
}else if(loc == "Who_Are_We"){
MM_nbGroup('down','group1','Whoweare','/Images/newsite/buttonimages/whobutover.jpg',1);
}

//-->
</script>