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 2 of 2

Thread: help with menu

  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with menu

    I have a JavaScript function as follows for a menu with a hidden dropdown:

    var timeout = 5;
    var closetimer = 0;
    var menuitem = 0;
    var browser = navigator.appName;


    function test(){


    }

    function mopen(id){







    }

    function mclose(){

    }

    function closetime(){

    }

    function cancelclosetime(){




    }

    document.onclick = mclose;




    I want to "call" into this html a JavaScipt function that will print the menu, so if there are edits to be done to the menu in the future, they can easily be done globally on all pages on the site by editing the single file.
    But this doesn't seem to be working -- my knowledge of JavaScript is very limited, not sure if I'm making a small quote error or just entirely off….


    document.write('<div id="siteNav">')
    document.write("<ul>")
    document.write("<li>")
    document.write('<a onmouseover="mopen(\'m1\')" onmouseout="closetime()">')
    document.write("<b>Some<\/b>")
    document.write(<"\/a>")
    document.write('<div id="m1" onmouseover="cancelclosetime()" onmouseout="closetime()">')
    document.write('<a href="./Some2.html">Topic of Some Page 2<\/a>')
    document.write('<a href="./Some3.html">Topic of Some Page 3<\/a>')
    document.write('<a href="./Some4.html">Topic of Some Page 4<\/a>')
    document.write('<a href="./Some5.html">Topic of Some Page 5<\/a>')
    document.write('<a href="./Some6.html">Topic of Some Page 6<\/a>')
    document.write('<a href="./Some7.html">Topic of Some Page 7<\/a>')
    document.write('<a href="./Some8.html">Topic of Some Page 8<\/a>')
    document.write("<\/li>")
    document.write("<\/ul>")
    document.write("<\/div>")

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Please do not cross post.

    Original thread: http://www.codingforums.com/showthread.php?t=162918
    OracleGuy


  •  

    Posting Permissions

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