PDA

View Full Version : Div menu with css, page detecting not working



Verna
Apr 6th, 2007, 09:56 AM
I made a menu that should know what page the visitor is in and it worked earlier when I was testing the layout. When it was ready I moved it to another folder in the server so it would show up for users, but it no longer works. I have triple checked that all the image addresses are right so at this point I can't think of what went wrong.

Navigation on file:

<div id="navigation">
<ul>
<li<?php if ($thisPage=="Alkusivu")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/index.php">ALKUSIVU</a></li>
<li<?php if ($thisPage=="Karvakorvat")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/karvakorvat.php">KARVAKORVAT</a></li>
<li<?php if ($thisPage=="Koulutus")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/koulutus.php">KOULUTUS</a></li>
<li<?php if ($thisPage=="Tietopankki")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/tietopankki.php">TIETOPANKKI</a></li>
<li<?php if ($thisPage=="In English")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/inenglish.php">IN ENGLISH</a></li>
<li<?php if ($thisPage=="Linkit")
echo " id=\"currentpage\""; ?>>
<a href="http://phantasmagory.net/doggit/linkit.php">LINKIT</a></li>
</ul>
</div>

Navigation part of the css:

#navigation ul {
list-style: none;
margin: 0;
padding:10px 10px 0;
}

#navigation li {
float: left;
background:url("http://phantasmagory.net/doggit/layout/norm_right.gif")
no-repeat right bottom;
margin: 0;
padding: 0;
}

#navigation a {
display:block;
background:url("http://phantasmagory.net/doggit/layout/norm_left.gif")
no-repeat left bottom;
padding:5px 15px;
text-decoration: none;
font-size: 10px;
color: #413625;
}

#navigation a {float:none;}

#navigation #currentpage {
background-image:url("http://phantasmagory.net/doggit/layout/norm_right_on.gif");
}

#navigation #currentpage a {
background-image:url("http://phantasmagory.net/doggit/layout/norm_left_on.gif");
}

Te background image for the links should change if the visitor is on the same page with any of those links, but it just stays the same. Other than that everything seems to work.

koyama
Apr 6th, 2007, 01:58 PM
When it was ready I moved it to another folder in the server so it would show up for users, but it no longer works.
You'll need to track down the problem. To me this looks like a php issue rather than problems with your HTML or CSS.

When you have loaded the web page then try to say View > Page Source from your browser menu and look for

<li id="currentpage">
If you don't see anything like this, there you have the problem. Then it is with your php script.