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 14 of 14
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My collapsing menu is finished

    Well, the first full version anyhow. Check it out here

    http://www.peterbailey.net/nm/

    Well, what I'm looking from from you guys (and gals ) is a couple things. First, I'd like it if you could check the browser compatibility page and help me fill in the blanks. Also, I'm wondering if there is any big or small features that you can think of that I haven't, that would be nice to add to this. Other than my own goal to make it OO, I haven't been able to think of much else.

    That's about it. Thanks!
    Last edited by beetle; 12-13-2002 at 05:46 AM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I get javascript errors when clicking on the submenu links in IE6

    Line: 114
    Error: nodeName is null or not an object.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I get "null is null or not an object" at line 115 when I click on Features or Setup

    When I click on Special operations or Browser compatibility, the menuy expands, and then immediately contracts again.

    This is in IE6 on Win2K

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys. It's been fixed. Let me know if you run into anything else.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I get the same thing as brothercake, every time I click Home, About, Special Operations, or Browser compatibility the menu
    expands and contracts. IE 6.0 NT6 sp6
    USA

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you got errors before, please check it again, I've made 1 more teeny change
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    works great in mozilla, great work beetle, and be sure to say when the cookie limitation is fixed.

  • #8
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Great script, works very good with CSS-based layouts.

    However, is there some way to make the menu "remember" which part was open after you click a link? I thought that was what that cookie thing was about. But it doesn't seem to work for me in IE6.
    OracleGuy

  • #9
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ya, I've had some frustrations with the cookie part. Unfortunately, I haven't been able to touch the script since the new fValidate has been keeping me super-busy. I really want to fix it up - but it will have to wait until fValidate is done.

    Couple weeks maybe?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #10
    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
    Does not expand for me in a 1.4 trunk build.

    I get this in the Javascript console:
    Error: subMenu.style has no properties
    Source File: http://www.peterbailey.net/nm/js/nm.js
    Line: 84
    Secondly, I'd appreciate a little bit of credit for this:
    Code:
        HTMLElement.prototype.click = function()
        {
            var evt = this.ownerDocument.createEvent('MouseEvents');
            evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
            this.dispatchEvent(evt);
        }
    (http://www.codingforums.com/showthre...ighlight=click)
    (http://www.codingforums.com/showthre...ighlight=click)

    Just common courtesy I guess.

    Lastly, your cookie limitation. You can store up to 1024 menu states in one value. (Math.log(Number.MAX_VALUE)/Math.log(2))

    Have each submenu represent a byte in a number, then shift bits out to the right until you run out of submenus when retrieving it. A 1 can represent open, a 0 can represent closed. e.g., say you have this:

    open
    open
    closed
    open
    closed

    This can be represented in binary as
    11010 which becomes 26, which you'd store. Then you can extract the bits using boolean algebra easily enough.
    Last edited by jkd; 07-08-2003 at 11:17 PM.

  • #11
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey jkd

    Thanks for the tips. I'll jump on those when I get around to it.

    I know about the problem w/the submenu thing - I actually have that fixed in the object version of the code (not linked to online yet)

    Sorry about the click() thing, an honest oversight. I was sure I had put some props in there for ya. I rectify that that post-haste.

    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #12
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    I await your new, improved version.
    OracleGuy

  • #13
    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
    One more thing I noticed:
    Code:
                if ( nm_config.is.ie )
                    li.attachEvent( "onclick", function() { nm_toggleDisp( li, currNode, event.srcElement ) } );
                else if ( nm_config.is.gecko )
                    li.addEventListener( "click", function(e) { nm_toggleDisp( li, currNode, e.target ) }, false);
    Bad, bad idea. You're limiting a perfectly fine DOM2 Events method to just Gecko browsers?

    I'd recommend checking

    document.implementation.hasFeature("Events", "2.0")

    Both Opera 7 and Gecko claim true on that, even though Opera is lacking mutation events... oh well. The important thing though is that it does return true, and that is a much superior check.

  • #14
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know. Again - something that's already different in the OO version. And probably 10 other things. It's old and I'd like to fix it, but I just have too many things on my plate with precedence.

    So, for the time being, please reserve any future criticisms, because I'm likely aware of them anyways.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”


  •  

    Posting Permissions

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