...

View Full Version : Navigation in CSS or other file



Hank
07-05-2002, 12:32 AM
I seen a couple of sites where all it says
<script language="Javascript">makeNavigation();</script>

I searched this forum without any results before I posted this question.

How do you put an existing menu in the CSS, js or what ever file so it shows for each page?

I got the drop down menu from a dhtml script and all I want to do now is make this global but I can't figure out where and how to declare the menu. :confused:

Graeme Hackston
07-05-2002, 12:38 AM
Remove the openning and closing <script> tags in your script and put the rest in a new file in a basic text editor (like Windows NotePad).

Save the file as what_ever_you_want.js and put this link in your pages where you had the script:

<script type="text/javascript" language="javascript" src="what_ever_you_want.js"></script>

Hank
07-05-2002, 04:23 AM
Thanks for your fast responce.
This does not work.
I got two .js files for that menu; plus the script. How do I compile those together and call it on the html page?

dingbatqueen
07-05-2002, 08:29 AM
Would this script (once you find out how to get it working - please let me know when you do!!) act just like a server-side include? I'd be interested in using it on a 500+ page site that I'm doing which uses complicated DHTML menus on each page. The server it's on doesn't support SSIs, so a call to an external file like you're talking about would work sooooo much better for me!! I'm converting the whole site this weekend to the new templates and would love to be able to use the script for each of the pages! :D Please let me know when you have it working so I can see how it's done. I'm not very good with javascript, so I know that I'll need to know how I would incorporate that into the page when I already have another javascript residing in each page? How does one go about using two javascripts - I know that I can't just put them together as it won't work. If I try to put one after another then it always seems to make one of them not work. I'm really stumped on how this all works. :confused:

Good luck!!

'ding' :cool:

Hank
07-05-2002, 06:17 PM
Originally posted by dingbatqueen
Would this script (once you find out how to get it working - please let me know when you do!!) act just like a server-side include? I'd be interested in using it on a 500+ page site that I'm doing which uses complicated DHTML menus on each page. The server it's on doesn't support SSIs, so a call to an external file like you're talking about would work sooooo much better for me!! I'm converting the whole site this weekend to the new templates and would love to be able to use the script for each of the pages! :D ...... :confused:

Good luck!!

'ding' :cool:
You lost me.
DHTML is just a fantacy word. It is is a combination of JavaScript, CSS and HTML. Neither of those are server side languages.
To make a menu or navigation within a server use Java, Perl or even Visual Basic.
But since DHTML is what it is, I find it extremly frustrating to learn, and the tuturials useless. So anyone please help. Thanks.

Graeme Hackston
07-05-2002, 11:15 PM
Originally posted by Hank
Thanks for your fast responce.
This does not work.
I got two .js files for that menu; plus the script. How do I compile those together and call it on the html page?

Try dumping all the scripts in 1 file and if that doesn't work:

<script type="text/javascript" language="javascript" src="script1.js"></script>
<script type="text/javascript" language="javascript" src="script2.js"></script>
<script type="text/javascript" language="javascript" src="script3.js"></script>

If that doesn't work post a link or the scripts to this thread.

Hank
07-05-2002, 11:25 PM
I did both. Neither works. Either I am dumb, or the script has a some feature disallowing it.
I posted the Navigation Menu in question also in the dynamicdrive.com forum, since I got it from them.

Anyway, thanks again for your help, at least now I know I did try the right things. ;)

adios
07-05-2002, 11:28 PM
The process of making a menu system 'global' is different for every menu; it mostly depends on how the HTML for the menu is output to the document. You'd need to give some idea of how the script works within one page.

Gordo
07-06-2002, 12:30 AM
I saw your cross-post in the DynamicDrive forum. Please do NOT start a new post for the same problem! Yes, this entire thread should be in the DD forum since it deals with a DD script (TopNavBarII), but it's up to the moderators to move this thread...if they want to. Personally, I'd go and delete your new post in the DD forum...but that's up to you.

Now, for your problem, the first reply you received here was right on target.

You need to save all of your navbar code (that's in the <head> of your page) into its own .js file. Then, call it directly underneath any other .js files associated with this menu. All of this should be in the <head>.

It worked for me.

For better instructions, please read my reply on the old WA forum here -- http://www.codingforums.com/ubb/Forum6/HTML/003124.html

When searching for your answers (which I commend you for doing!), this new CodingForums won't have too many answers for awhile (still a baby forum post-wise). The old WA has TONS of answers. The link to the old forum is in the upper right corner of this page.

Good luck.

Hank
07-06-2002, 10:06 PM
Originally posted by adios
The process of making a menu system 'global' is different for every menu; it mostly depends on how the HTML for the menu is output to the document. You'd need to give some idea of how the script works within one page.
The code works like a charme on my free site
http://liquid2k.com/henrywerner/
When I put in the script part as a .js file it does not work
http://liquid2k.com/henrywerner/html/Rev02.html
it does however with the script placed in the html page
http://liquid2k.com/henrywerner/html/Rev01.html

Hank
07-06-2002, 10:14 PM
Originally posted by Gordo
I saw your cross-post in the DynamicDrive forum. Please do NOT start a new post for the same problem! Yes, this entire thread should be in the DD forum since it deals with a DD script (TopNavBarII), but it's up to the moderators to move this thread...if they want to. Personally, I'd go and delete your new post in the DD forum...but that's up to you.

Now, for your problem, the first reply you received here was right on target.

You need to save all of your navbar code (that's in the <head> of your page) into its own .js file. Then, call it directly underneath any other .js files associated with this menu. All of this should be in the <head>.

It worked for me.

For better instructions, please read my reply on the old WA forum here -- http://www.codingforums.com/ubb/Forum6/HTML/003124.html

When searching for your answers (which I commend you for doing!), this new CodingForums won't have too many answers for awhile (still a baby forum post-wise). The old WA has TONS of answers. The link to the old forum is in the upper right corner of this page.

Good luck.
Ok , I wont do it again, I was/am frustrated at this HTML/CSS/JavaScript mess.!!!

As I said I tryed everything, the navigation bar wont show.

I will do a search in the old forums, and keep you posted.

Gordo
07-06-2002, 11:37 PM
I know frustration...trust me...I know how you're feeling.

Okay, I don't know the exact problem, but I'm 99% sure that the reason your http://liquid2k.com/henrywerner/html/Rev02.html page is not working involves the navcond.js file. And that's the file that should not be edited.

At this point, I strongly suggest you go back to http://www.dynamicdrive.com/dynamicindex1/topnavbar.htm and re-download the navcond.js file and upload it to your server. See if that does the trick. It'll only take a minute or two.

I can't for the life of me remember where/when I got the file listing below, but I have the following in my <head>:

<script language="JavaScript" src="ua.js"></script>
<script language="JavaScript" src="xbDebug.js"></script>
<script language="JavaScript" src="xbDOM.js"></script>
<script language="JavaScript" src="xbStyle.js"></script>
<script language="JavaScript" src="xbstyle-dhtmllib.js"></script>
<script language="JavaScript" src="xbstyle-navbar.js"></script>
<script language="JavaScript" src="mynavbar.js"></script>

Hank
07-08-2002, 07:34 PM
The server at the Uni was down, I am finaly back online.

I did take the latest navcond.js file and uploaded it.
Also the files xbstyle-dhtmllib.js, xbstyle-navbar.js sounds like the original files.
nacond is the condensed version of 'dhtmllib' and 'navbar'.

This also I tried to use the uncondensed files to make them work.

Also liquid2k is slow again, and now I can't go into my site for further investigation.

Any further idea let me know. :(

dingbatqueen
07-08-2002, 09:11 PM
I hope this is a simple fix - I can't get the darn thing to work no matter what I try! I hope that this is even possible... Here is a sample of the page - what it should ultimately look like with the flyout menus at the left:
http://www.captivedesigns.com/FlexNew1/index.htm

I put the left navigation along with the layers into a .js file - actually I tried this with 2 different .js files. Neither of the pages work! Here's where they are:
http://www.captivedesigns.com/FlexNew1/TESTINGjs.htm
http://www.captivedesigns.com/FlexNew1/TESTINGjs1.htm

The .js files are at:
http://www.captivedesigns.com/FlexNew1/leftnav.js
http://www.captivedesigns.com/FlexNew1/leftnavonly.js

Did I do something wrong here, or is it not possible to do this? The challenge is that this site will have over 350 pages and they expect the left navigation to change frequently. I want to put in code that would pull from just one navigational file, so that I need to make changes to only one file and the rest of the site would be automatically updated. I don't want this to be a server-side function as they also migrate to different servers and the functionality can change. It's imperative that all of the scripting be done on the client side.

Can anyone help me??!! THANK YOU!!!

'ding'

Hank
07-08-2002, 10:09 PM
Never mind I got a new menu and it works.

Thanks for the help though we tried! :cool:

Graeme Hackston
07-09-2002, 12:43 AM
dingbatqueen, if this is an external .js file

http://www.captivedesigns.com/FlexNew1/leftnavonly.js

Then none of what I pasted below should be in it.

<link rel="stylesheet" href="FlexStyles.css" type="text/css">
<script language="JavaScript">
<!--
//-->
</script>
<script language="JavaScript">
<!--

If all that HTML is part of the menu you have a lot of document.write to do. You might want to try a FrontPage "include" page.

Do you have a link to the menu on its own?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum