Web Analytics Made Easy -
StatCounter Expanding/Collapsing Menus in NS6 - CodingForum

Announcement

Collapse
No announcement yet.

Expanding/Collapsing Menus in NS6

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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.
    "nam et ipsa scientia potentas est" - Francis Bacon

  • #2
    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.
    Check out the Forum Search. It's the short path to getting great results from this forum.

    Comment


    • #3
      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
      "nam et ipsa scientia potentas est" - Francis Bacon

      Comment


      • #4
        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.
        jasonkarldavis.com

        Comment


        • #5
          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.
          Check out the Forum Search. It's the short path to getting great results from this forum.

          Comment


          • #6
            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; Jun 24, 2002, 06:55 PM.

            Comment

            Working...
            X