SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HELP! Menu Scripting

    Damn I hate javascript. Everytime I try to use it there's problems and I can't seem to debug. Sitepointers, unite!! I'm redesigning my very first website since I know alot more and don't use Frontpage anymore. This is still in the works. No site to see yet.

    I am using the js source from Netscape's Developer area. The source is at http://developer.netscape.com/viewso..._menu/menu.js. I guess I pretty much overrid most of the default menu settings provided and used my own instead, but there's valuable script in there I don't know about, I'm sure, so in case you need to look at it, there it is.

    So now here is my script on my page along with pertinent rollovers. What I am trying to do is get these menus to pop up onMouseOver of an imagemap.

    Code:
    <html>
    <head>
    <title>All Nations Church of Durham</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="/anc.css" type="text/css">
    <script language="javascript" src="menu.js">
    window.ANCMenu = new Menu("ANCMenu");
    ANCMenu.addMenuItem("A Word From Our Pastor", "location='http://www.livingpages.net/anc/word.htm'", "target='_same'");
    ANCMenu.addMenuItem("Vision and Purpose", "location='http://www.livingpages.net/anc/vision.htm'", "target='_same'");
    ANCMenu.addMenuItem("What We Believe", "location='http://www.livingpages.net/anc/sof.htm'", "target='_same'");
    ANCMenu.fontColor="#fff99";
    ANCMenu.menuItemBgColor="#000060";
    ANCMenu.disableDrag = true;
    ANCMenu.writeMenus();
    
    window.AboutMenu = new Menu("AboutMenu");
    AboutMenu.addMenuItem("Who We Are", "location='http://www.livingpages.net/anc/about.htm'", "target='_same'");
    AboutMenu.addMenuItem("Pastor Tom Brazell", "location='http://www.livingpages.net/anc/bio.htm'", "target='_same'");
    AboutMenu.addMenuItem("Pastor Tom's Testimony", "location='http://www.livingpages.net/anc/testimony.htm'", "target='_same'");
    AboutMenu.fontColor="#fff99";
    AboutMenu.menuItemBgColor="#000060";
    AboutMenu.disableDrag = true;
    AboutMenu.writeMenus();
    
    window.SupportMenu = new Menu("SupportMenu");
    SupportMenu.addMenuItem("Prayer Needs", "location='http://www.livingpages.net/anc/prayer.htm'", "target='_same'");
    SupportMenu.addMenuItem("Praise Reports", "location='http://www.livingpages.net/anc/answered.htm'", "target='_same'");
    SupportMenu.addMenuItem("Support Us", "location='http://www.livingpages.net/anc/support.htm'", "target='_same'");
    SupportMenu.fontColor="#fff99";
    SupportMenu.menuItemBgColor="#000060";
    SupportMenu.disableDrag = true;
    SupportMenu.writeMenus();
    
    window.MiscMenu = new Menu("MiscMenu");
    MiscMenu.addMenuItem("Contact ANC", "location='http://www.livingpages.net/anc/contact.htm'", "target='_same'");
    MiscMenu.addMenuItem("Other Links", "location='http://www.livingpages.net/anc/links.htm'", "target='_same'");
    MiscMenu.addMenuItem("Copyright Information", "location='http://www.livingpages.net/anc/copyright.htm'", "target='_same'");
    MiscMenu.fontColor="#fff99";
    MiscMenu.menuItemBgColor="#000060";
    MiscMenu.disableDrag = true;
    MiscMenu.writeMenus();
    
    </script>
    </head>
    followed by the function call in the body
    Code:
    <img src="menubar.gif" width="760" height="29" usemap="#Menu" border="0">
    <map name="Menu"> 
      <area shape="rect" coords="74,4,126,25" href="home.htm" target="_top">
      <area shape="rect" coords="157,4,291,25" href="javascript://window.showMenu(window.ANCMenu);" onMouseOver="window.showMenu(window.ANCMenu);" target="_self">
      <area shape="rect" coords="318,4,395,25" href="javascript://" target="_self" onMouseOver="showMenu(AboutMenu);" onMouseOut="hideMenu(AboutMenu);">
      <area shape="rect" coords="442,4,587,25" href="javascript://" target="_self" onMouseOver="showMenu(SupportMenu);" onMouseOut="hideMenu(SupportMenu);">
      <area shape="rect" coords="620,4,680,25" href="javascript://" target="_self" onMouseOver="showMenu(MiscMenu);" onMouseOut="hideMenu(MiscMenu);">
    </map>
    Can anyone help me?

    Sketch
    Aaron Brazell
    Technosailor



  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh and incidentally, ignore most of the junk in the function call portion of the body. Most is leftover garbage from fiddling with it. Basically, I was trying to get the first Mouseover item in the imagemap working so that once I had the format, I could transfer it to the other three portions of the image map. Obviously, none of it was working. Also does anyone have any insight as to whether this will TRULY work with both browsers. It supposedly will, and then again right now it's not working with either!" LOL

    Sketch
    Aaron Brazell
    Technosailor




Bookmarks

Posting Permissions

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