Jump to content

Menu items dissapear randomly..


garry

Recommended Posts

The following image is what my menu is supposed to look like and what it usually does look like.

 

picture6kr4.png

 

The next image is what it looks like sometimes, it's seemingly random and I have no idea why it would do it because when checking the source, the html appears like it should be with the list items but they don't appear.

 

picture5cb6.png

 

Here's the code I'm using, maybe you can figure out why it's happening.

 

<div id="menu">
		<ul>
			<li<?php echo($page == 'Home' ? " class=\"current\"" : ""); ?>><a href="index.php"><b>Home</b></a></li>
			<li<?php echo($page == 'About' ? " class=\"current\"" : ""); ?>><a href="about.php"><b>About</b></a></li>
			<li<?php echo($page == 'Page1' ? " class=\"current\"" : ""); ?>><a href="page1.php"><b>Page 1</b></a></li>
			<li<?php echo($page == 'Page2' ? " class=\"current\"" : ""); ?>><a href="page2.php"><b>Page 2</b></a></li>
			<li<?php echo($page == 'Contact' ? " class=\"current\"" : ""); ?>><a href="contact.php"><b>Contact</b></a></li>
		</ul>
	</div>

#menu ul {margin:0 auto; padding:0; list-style:none; display:table; white-space:nowrap; list-style:none; height:2em; position:relative; font-size:0.9em;}
#menu li {display:table-cell; margin:0; padding:0;}
#menu li a {display:block; float:left; height:2em; line-height:2em; color:#333; text-decoration:none; font-family:arial, verdana, sans-serif; font-weight:bold; text-align:center; padding:0 0 0 12px; cursor:pointer; background:url('menu/0a.gif') no-repeat;}
#menu li a b {float:left; display:block; padding:0 12px 0 0; background:url(menu/0b.gif) no-repeat right top;}
#menu li.current a {color:#000; background:url(menu/2a.gif) no-repeat;}
#menu li.current a b {background:url(menu/2b.gif) no-repeat right top;}
#menu li a:hover {color:#000; background: url(menu/1a.gif) no-repeat;}
#menu li a:hover b {background:url(menu/1b.gif) no-repeat right top;}
#menu li.current a:hover {color:#000; background: url(menu/2a.gif) no-repeat; cursor:default;}
#menu li.current a:hover b {background:url(menu/2b.gif) no-repeat right top;}

Link to comment
https://forums.phpfreaks.com/topic/116559-menu-items-dissapear-randomly/
Share on other sites

Hi,

 

Why don't you try:

 

<div id="menu">

<ul>

<li><?php echo($page == 'Home' ? " class=\"current\"" : ""); ?>><a href="index.php"><b>Home</b></a></li>

<li><?php echo($page == 'About' ? " class=\"current\"" : ""); ?>><a href="about.php"><b>About</b></a></li>

<li><?php echo($page == 'Page1' ? " class=\"current\"" : ""); ?>><a href="page1.php"><b>Page 1</b></a></li>

<li><?php echo($page == 'Page2' ? " class=\"current\"" : ""); ?>><a href="page2.php"><b>Page 2</b></a></li>

<li><?php echo($page == 'Contact' ? " class=\"current\"" : ""); ?>><a href="contact.php"><b>Contact</b></a></li>

</ul>

</div>

 

Maybe that will work, as everything else looks fine.

 

~Py

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.