943,938 Members | Top Members by Rank

Ad:
Oct 21st, 2005
0

How to set up include file for navbar

Expand Post »
I have a set of pages on my site that I want to connect with a tabbed navbar so that as each tab is clicked, the page reloads with the appropriate data. I also want the button clicked to be properly highlighted to show which page it currently selected.

I have a set of buttons with 3 states, regular, over and on. I have set the mouseover, mouseout events to call the gif based on the appropriate state within the <img> tags. I want to write the code to use the "on" state based on the form loaded -- this will require a little bit of coding.

I think I can set all this up BUT -- I really want to put all this in an include file and call it in the appropriate place on each page. What I don't know is how to format the include file. Is it a file with the button img code within the <html></html> tags (only)? All the include files I've used have been code only, no images.

Can someone point me in the right direction? Can this be done?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vcombs is offline Offline
2 posts
since Dec 2004
Oct 21st, 2005
0

Re: How to set up include file for navbar

I assume you already have a server-side method for your inclusion (PHP, or SSI), and that your question is soley "what do I put in the external file": just the HTML code itself should work fine.

If you want an "almost" completely client-side solution, then you can set the contents of your nav element via JavaScript, and include the js with standard syntax:

HTML and CSS Syntax (Toggle Plain Text)
  1. <script type="text/javascript" src="myNavBar.js"></script>

Place that in the head of your document. The JavaScript file will contain everything except the "script" tags. The code within the JavaScript will "set" the contents of your navbar element.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: div comes vertical when i need it horizontal sideby side as columns
Next Thread in HTML and CSS Forum Timeline: CSS -- table border and table header color





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC