SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Javascript menu

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Scotland
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript menu

    Hi Guys, need a wee bit of help is possible, trying to create this menu: Horizontal menu

    and insert it into a table cell within a web page.

    Been asked to put the following immediately after the body tag:
    <script type='text/javascript'>

    function Go(){return}

    </script>
    <script type='text/javascript'>src='exmplmenu_var.js'</script>
    <script type='text/javascript' src='menu_com.js'></script>
    <noscript>Your browser does not support script</noscript>

    Have formatted the external scriptbut how do i get the menu to appear on my page where i need it to?

    Again prob a simple stupid problem, been having a few of those cant see the wood for the trees days lately.

    Must be the thought of Christmas....

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Scotland
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone any ideas? please?

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have a link to the page you are working on?

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you read the documentation here?

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Scotland
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get two errors (in Opera). Check these out first.
    Code:
    http://www.chronicles-consultancy.co...mplmenu_var.js
    Unknown context
    Syntax error while loading (line 89)
    Menu5_3=new Array("Rose Petals","#","",0,)
    --------------------------------------------^
    
    
    Inline script thread
    Error:
    name: ReferenceError
    message: Statement on line 26: Reference to undefined variable: No such variable 'StartTop'
    Backtrace:
      Line 26 of linked script http://www.chronicles-consultancy.co...ng/menu_com.js
        var M_StrtTp = StartTop, M_StrtLft = StartLeft;

  7. #7
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Scotland
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seem to have got those fixed it looks as if the browser is trying to build the menu but i'm now getting stack overflow line:89

    Well and truly bamboozled now.

    Web Page

    menu_com.js

    Exmplmenu_var.js

    Have spent about 8 hours on this and its now doing my head in. Any help would be greatly appreciated.

  8. #8
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The scripts and Go function are included twice.

  9. #9
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Scotland
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What script do they appear twice in please?

    Sorry for being such a newb!

  10. #10
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, it's working! Way to go!

    On Win2K...

    Opera 7.51: Works great, no errors.

    IE 6.0: Works great, no errors.

    Mozilla 1.7.2: Error: 'Layer' is not defined, Line 347 (Perhaps the script thinks Moz is NN4?)

  11. #11
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In bar.js, the first line of the sniffer code needs to be modified, perhaps like this:
    Code:
    var isMinNS4=(document.layers && navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion)>=4) ? 1:0;
    The sniffer code is detecting Opera as isMinIE4. You're lucky because Opera does support those ele.pixelXXX properties. However, AFAIK Mozilla does not support those properties. So, the above change is not going to help it work in Moz, altho it may keep Moz from throwing errors.


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
  •