Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    southern Alabama
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Adding drop down menu to CSS

    I have a drop-down menu on the home page of my website, but I would like to have the same menu on each page to make navigation easier. Since I'm already using CSS on my site, is there a way to add the list items in the style sheet, so I can add new items in just one place, instead of having to add the new item to each page? I'm fairly new to CSS, but I'm using Dreamweaver, which has been a big help. Thanks in advance for your help.
    Beth M. Rogers
    "For I know the plans I have for you" declares the Lord, "plans to prosper you and not to harm you, plans to give you hope and a future." Jer. 29:11

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Hmm ........

    I think what we are talking here is the creation of a .JS file to write menu in each page and a CSS style sheet.

    Post your URL so that I can take a look at the script and layout.

    Can't hurt to look

  • #3
    New Coder
    Join Date
    Dec 2002
    Location
    southern Alabama
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My home page is http://rogerswebnet.net - I appreciate it!
    Beth M. Rogers
    "For I know the plans I have for you" declares the Lord, "plans to prosper you and not to harm you, plans to give you hope and a future." Jer. 29:11

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you could:

    create a .js file and add your menu script in that (without the <script></script> tags, with a document write.
    then you can link through the page with a script call, either way you will have to edit each page.

    in .js file:
    document.write('<select><option></option></select>');


    on page ( where you want script to appear )

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


    that should work ,then later you can just edit the .js file to edit the menu, and the positioning of the file with the script call on the page, hope that helps

    if you need it explained better ( i apologize ) just say so
    Last edited by cg9com; 12-02-2002 at 09:41 PM.

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    save the following as menu.js


    function go(){
    location=
    document.mycombo.example.options[document.mycombo.example.selectedIndex].value
    }

    document.write("<FORM name=mycombo>"
    +"<SELECT size=1 name=example>"
    +" <OPTION value=portfolio.html selected>Our Portfolio</OPTION>"
    +" <OPTION value=mission.html>Our Mission Statement</OPTION>"
    +" <OPTION value=faq.html>Frequently Asked Questions</OPTION>"
    +" <OPTION value=topten.html>Top Ten</OPTION>"
    +" <OPTION value=theplan.html>The Plan*</OPTION>"
    +" <OPTION value=rings.html>Rings, Memberships and Links</OPTION>"
    +" <OPTION value=tribute.html>A Tribute</OPTION>"
    +" <OPTION value=personal/index.html>Personal Information</OPTION>"
    +" <OPTION value=contact.html>Contact Information</OPTION>"
    +" <OPTION value=ads.html>Submit Your Ads</OPTION>"
    +" <OPTION value=tcb.html>Takin' Care of Business</OPTION>"
    +" <OPTION value=sample.html>Sample Issue</OPTION>"
    +" <OPTION value=article.html>Submit Articles</OPTION>"
    +" <OPTION value=360/index.html>DragonFly 360 Productions</OPTION>"
    +"</SELECT>")


    In all the pages that are going to show the menu copy the following


    <script src="menu.js"></script>

    And

    <A href="javascript:go()">Your Link</A>


    I have attached a zip file with the .js file and three html pages for you to take a look at
    Attached Files Attached Files

  • #6
    New Coder
    Join Date
    Dec 2002
    Location
    southern Alabama
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thank you very much!

    Thanks very much - I'll try this and let you know how it comes out. I appreciate you both going to so much trouble.
    Beth
    Beth M. Rogers
    "For I know the plans I have for you" declares the Lord, "plans to prosper you and not to harm you, plans to give you hope and a future." Jer. 29:11

  • #7
    New Coder
    Join Date
    Dec 2002
    Location
    southern Alabama
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up thanks again!

    Thank you both again so much - I've loaded the scripts and other information on my pages - this is a life-saver - I wanted to have navigation on all pages, but didn't want to take a chance on not getting all information on each page - thank you! Thank you! Thank you!
    Beth M. Rogers
    "For I know the plans I have for you" declares the Lord, "plans to prosper you and not to harm you, plans to give you hope and a future." Jer. 29:11


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •