469,344 Members | 5,505 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

problem counting ul elements in firefox for collapsible outline menu

Elyse Summers
I'm working on a collapsible outline navigation system for my company's new site and I've got it working fine in IE8, but in Firefox the list and nodes load fully extended. (http://www.ghjohnsontrading.com/elys...rnishings.html) I asked someone for help debugging and we think it's a problem with this area:

Expand|Select|Wrap|Line Numbers
  1. function outlineInitOutline(outline)
  2. {
  3.     var kids = outline.childNodes;
  4.     for (var i = 0; (i < kids.length); i++) {
  5.         var kid = kids[i];
  6.         if (kid.nodeName == "LI") {
  7.             outlineInitItem(kid);
  8.         }
  9.     }
  10. }
  11.  
Not returning the proper number of nodes in Firefox because of the known white-space bug of evil. It's collapsing fine in IE8, Chrome & Safari

(side note: though in Chrome and Safari I have heinous black boxes around my "+" and "-" signs - I think I can fix that by adjusting the line height, any thoughts? It fixed in IE by sticking in a border=0 o.img function in my outline.css file)

but Firefox is refusing to cooperate. I'm new at JavaScript and this is really irritating me, I hope someone can help? Here's a complete list of the files/pages I'm using/drawing from if you'd like to see complete code:
http://www.ghjohnsontrading.com/elysetest/outline.js
http://www.ghjohnsontrading.com/elys...rnishings.html
http://www.ghjohnsontrading.com/elys...ylesheet01.css
http://www.ghjohnsontrading.com/elysetest/outline.css

I think that should be everything. I hope someone who's better at this than I am can help :)
Sep 17 '10 #1

✓ answered by gits

firefox works correct :) - the problem is in furnishings.html - where you have invalid (overlapping) markup - it's line 105:

Expand|Select|Wrap|Line Numbers
  1. <br></p></font>
has to be:

Expand|Select|Wrap|Line Numbers
  1. <br></font></p>
otherwise the childNode collection is not what you think it would be - firefox will give you a font-node as childNode then. so fix the above error and it should work.

btw. it is much preferable to put real layout-directives (like the font-tag in question) into the css file to have a cleaner markup ...

kind regards,
gits

PS: regarding the css issue with the 'black borders' - the image-node would just need to have the background color that you want to have there - just apply a class or whatever to avoid that issue ...

PSPS: i forgot to mention that the visual design of the page looks quite nice - looking forward to see how this will proceed ...

3 1526
gits
5,390 Expert Mod 4TB
firefox works correct :) - the problem is in furnishings.html - where you have invalid (overlapping) markup - it's line 105:

Expand|Select|Wrap|Line Numbers
  1. <br></p></font>
has to be:

Expand|Select|Wrap|Line Numbers
  1. <br></font></p>
otherwise the childNode collection is not what you think it would be - firefox will give you a font-node as childNode then. so fix the above error and it should work.

btw. it is much preferable to put real layout-directives (like the font-tag in question) into the css file to have a cleaner markup ...

kind regards,
gits

PS: regarding the css issue with the 'black borders' - the image-node would just need to have the background color that you want to have there - just apply a class or whatever to avoid that issue ...

PSPS: i forgot to mention that the visual design of the page looks quite nice - looking forward to see how this will proceed ...
Sep 18 '10 #2
Thank you so much for your help - isn't it always the little things that slip by you? Having this fixed is such a relief because I can move onto content now - again, thanks! I really appreciate the fix (and the helpful advice.) This is my first time doing a site on this scale using JavaScript, so I'm sure I'll be back with more questions as I continue... and to see if I can be of any help, of course :)

Elyse
Sep 20 '10 #3
gits
5,390 Expert Mod 4TB
no problem :) - just post back to the forums anytime you have more questions ...

kind regards,
gits
Sep 20 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Michael H Lees | last post: by
1 post views Thread by walexand | last post: by
2 posts views Thread by Paul Bicknell | last post: by
1 post views Thread by Eirik Eldorsen | last post: by
5 posts views Thread by Ouray Viney | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.