You are here: Where would I put this markup and script « HTML « IT news, forums, messages
Where would I put this markup and script

Posted by John Salerno on 02/06/06 02:25

Perhaps this is getting a little ahead of myself, but here goes...

The goal: to have a navigation bar on all my pages that consists of
several buttons that link to other pages on my site. For example,
"Home", "Blog" and "Contact".

I'd also like to use some JavaScript to get this functionality: when you
mouseover a button, it changes (and mouseout changes it back). When you
click on it it changes, and once you are on the new page, it is
different from the rest to show that you are on that page.

Now, I know how to do this for one button, and I have found a tutorial
for how to do it with multiple buttons
(http://www.webreference.com/js/column1/multiple.html), but it's not
very complete. I understand the code that is there, but now exactly how
to implement it or where to put it.

I assume that for the navigation bar, I could use a PHP include
statement. But since each page will have a slightly different nav bar
(since the current button will be different), I don't know what to do
from there. Do I simply set up a list of the buttons for each page, like:

<img src="home><img src="blog"><img src="contact">

and then just change the src of whichever image needs to be different?
That would result in three different possible includes. Is there a way
for a PHP script to figure out which page you are on, so you can use the
proper nav bar?

Finally, where would all the JavaScript go?

I guess my ultimate question is, how do I break up these tasks, how many
files do I need to do this, etc. Would I be able to have just a single
file with all these options, and this would be the file I include on
each page?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация