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 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Caerdydd
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Expanding/Collapsing Menus in NS6

    Hi guys,

    I've written an expanding and collapsing navigation menu for my website. I'm using <div>s for the submenus and changing the style.visibility and style.display properties to show and hide them. The problem I have is the different behaviour between browsers. It works OK in MSIE but in NS6 when you hide the submenu it leaves a huge gap where the menu was, rather than realigning the menu. You can see what I mean here. I think the problem could be something to do with Netscape's treatment of tables, but I'm not sure how to change it. If you have any suggestions I'd be very pleased to hear them.

    Cheers.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was going to try and help you but your browser detection code totally misses when I tried it with the Mozilla browser (Netscape 6+ is just a cheap knock-off). You need to refine your detection code to accept any Gecko based browser and not just Netscape branded versions.

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Caerdydd
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Roy, I have amended my browser detection script and downloaded Mozilla. The realignment problem doesn't occur in Mozilla, so should I assume that this is a problem with NS (I am using v6.1)? If you're still interested I'd really appreciate your thoughts.

    BL

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    NS6.1 is based on an older version of Mozilla, which means more bugs were still unfixed.

    This is true for all version of NS, even NS7 PR, which is based on Moz 0.99 (?), and the current official release is Moz 1.0, and you can grab Moz 1.1 Alpha if you please too.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by bassleader
    Thanks Roy, I have amended my browser detection script and downloaded Mozilla. The realignment problem doesn't occur in Mozilla, so should I assume that this is a problem with NS (I am using v6.1)? If you're still interested I'd really appreciate your thoughts.

    BL
    Take a look at the release notes for Mozilla, they may tell you about a positioning bug in earlier versions that they fixed which may give you a clue about what you can do to fix it in the Netscape 6x browsers. Netscape 7 should be based on Mozilla 1.0 so how long you'll need a fix really depends on how long it takes to get the majority of users to move away from those "beta browser as a released version" Netscape 6x browsers.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    624
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This works in NN6.2.1 on Win98.

    <html>
    <head>
    <title>Expand</title>
    <script language="JavaScript" type="text/javascript">
    <!-- Hide script from older browsers

    function toggle(Sub) {
    if (document.getElementById) {
    thisMenu = document.getElementById(Sub).style
    if (thisMenu.display == "block") {
    thisMenu.display = "none"
    }
    else {
    thisMenu.display = "block"
    }
    return false
    }
    else {
    return true
    }
    }

    // End hiding script -->
    </script>

    <style>
    .Subs {display: none;}
    </style>

    </head>
    <body>

    <a href="page.html" onClick="return toggle('Sub1')">Heading 1</a><br>
    <span class="Subs" ID="Sub1">
    content
    </span>
    <a href="javascript:void(0);" onClick="return toggle('Sub2')">Heading 2</a><br>
    <span class="Subs" ID="Sub2">
    content
    </span>
    <a href="#" onClick="return toggle('Sub3')">Heading 3</a>
    <span class="Subs" ID="Sub3">
    content
    </span>
    </body>
    </html>

    </edit>I had an open tag<edit>
    Last edited by Graeme Hackston; 06-24-2002 at 11:55 PM.


  •  

    Posting Permissions

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