Web Analytics Made Easy -
StatCounter Navigation in CSS or other file - CodingForum

Announcement

Collapse
No announcement yet.

Navigation in CSS or other file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Navigation in CSS or other file

    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.
    Time waits for no one ...

  • #2
    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>

    Comment


    • #3
      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?
      Time waits for no one ...

      Comment


      • #4
        Question

        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! 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.

        Good luck!!

        'ding'

        Comment


        • #5
          Re: Question

          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! ......

          Good luck!!

          'ding'
          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.
          Time waits for no one ...

          Comment


          • #6
            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.

            Comment


            • #7
              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.
              Time waits for no one ...

              Comment


              • #8
                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.

                Comment


                • #9
                  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.codingforum.net/ubb/Forum6/HTML/003124.html

                  When searching for your answers (which I commend you for doing!), this new CodingForum 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.
                  Gordo
                  "In the End, we will remember not the words of our enemies, but the silence of our friends."
                  - Martin Luther King Jr. (1929-1968)

                  Comment


                  • #10
                    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

                    When I put in the script part as a .js file it does not work

                    it does however with the script placed in the html page
                    Time waits for no one ...

                    Comment


                    • #11
                      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.codingforum.net/ubb/Forum6/HTML/003124.html

                      When searching for your answers (which I commend you for doing!), this new CodingForum 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.
                      Time waits for no one ...

                      Comment


                      • #12
                        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>:

                        [color=royal blue]<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>[/color]
                        Gordo
                        "In the End, we will remember not the words of our enemies, but the silence of our friends."
                        - Martin Luther King Jr. (1929-1968)

                        Comment


                        • #13
                          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.
                          Time waits for no one ...

                          Comment


                          • #14
                            I CAN'T GET THIS TO WORK - HELP!!!

                            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:


                            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:



                            The .js files are at:



                            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'

                            Comment


                            • #15
                              Never mind I got a new menu and it works.

                              Thanks for the help though we tried!
                              Last edited by Hank; Jul 8, 2002, 06:08 PM.
                              Time waits for no one ...

                              Comment

                              Working...
                              X