View Full Version : My collapsing menu is finished
beetle
12-12-2002, 03:11 PM
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 (http://www.peterbailey.net/nm/index.php?page=compat) 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!
Spookster
12-12-2002, 04:03 PM
I get javascript errors when clicking on the submenu links in IE6
Line: 114
Error: nodeName is null or not an object.
brothercake
12-12-2002, 04:28 PM
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
beetle
12-12-2002, 04:30 PM
Thanks guys. It's been fixed. Let me know if you run into anything else.
landon11
12-12-2002, 09:40 PM
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
beetle
12-13-2002, 05:38 AM
If you got errors before, please check it again, I've made 1 more teeny change :D
chrismiceli
12-15-2002, 06:25 AM
works great in mozilla, great work beetle, and be sure to say when the cookie limitation is fixed.
oracleguy
07-08-2003, 09:45 PM
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.
beetle
07-08-2003, 10:08 PM
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?
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:
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/showthread.php?s=&threadid=9756&highlight=click)
(http://www.codingforums.com/showthread.php?s=&threadid=7495&highlight=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.
beetle
07-08-2003, 11:55 PM
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.
:D
oracleguy
07-09-2003, 12:02 AM
I await your new, improved version.
One more thing I noticed:
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.
beetle
07-09-2003, 04:50 AM
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. ;)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.