Jump to content

navigation help


nezbo

Recommended Posts

Hi all

 

I am not to sure where to start with this :

 

what i want to do is have a navigation bar the is very simular to the php freaks forum nav thing. the "home | help | search | profile | my Messages etc..." bit. if i click on home the button apperes to pop out.

 

any ideas where to start looking ?

 

Cheers.

 

 

Link to comment
https://forums.phpfreaks.com/topic/99503-navigation-help/
Share on other sites

You could do something simple that sets a variable on your page

 

At the top of the page you can declare $page

Your home.php would be something like

 

<?php
$page = 'home';
?>

 

Then down your code you could do something like.

		<a href="home.php"><img <?php if ($page == 'home') { echo "src='home-on.gif'"; } else { echo "src='home.gif'"; } ?>></a>
		<a href="contact.php"><img <?php if ($page == 'contact') { echo "src='contact-on.gif'"; } else { echo "src='contact.gif'"; } ?>></a>

 

 

Hope that helps you get started.

Link to comment
https://forums.phpfreaks.com/topic/99503-navigation-help/#findComment-509067
Share on other sites

the phpfreaks one is done using images. what you can do firstly is to use css classes, and have the current page link in bigger text and a different color, then you'll see how the image one will work.

 

Yes, CSS is what I do also. Same concept though if you want to have the 'current' page selected like this site does. CSS will also do the 'hover' effect.

 

 

r-it, your image man.. I really thought there was a bug on my screen lol

Link to comment
https://forums.phpfreaks.com/topic/99503-navigation-help/#findComment-509068
Share on other sites

Cheers for that, i am not to sure how to get it to see current page...

 

i am using one nav.php incuded in the top page and the main section is the only difrent bit, i was thinking i could do it by looking at the url and seting the image acordingly.

 

Hope this make sense?

 

this is my nav bar so for...

<div align="right" class="navText">
</div>

 

this is the top.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="style.css" />
<!-- the files to be included with in the php coding -->
<?php
include ("includes/dbcon.php");
include ("language/english.php");
?> 
<!-- /the files to be included with in the php coding -->
<title>
<?php echo COMPANY_NAME; ?>
</title>
</head>
<body>
<!-- Script for seting the loading immage using the inner html div id loadingImmage -->
<div style="position:absolute; top:40%; left:40%;" id='loadingImmage'></div>
<script type="text/javascript">
var loadingImmage = document.getElementById('loadingImmage');
loadingImmage.innerHTML = '<img src="images/loading.gif" alt="Leading Page" >';  
</script>
<!-- /Script for seting the loading immage using the inner html div id loadingImmage -->

<!-- Start of the standard page scripts anything after this page will be in the main section of the page. -->
<!-- This is to setup the headder and the left hand columd if needed. the container class is the basic design class -->

<div class="hedder">
<?php
	include("hedder.php");
?>
</div> 

<div class="nav">
<?php
	include("nav.php");
?>
</div>

<div class="main">

 

the phpfreaks one is done using images. what you can do firstly is to use css classes, and have the current page link in bigger text and a different color, then you'll see how the image one will work.

Link to comment
https://forums.phpfreaks.com/topic/99503-navigation-help/#findComment-509069
Share on other sites

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.