Help with Expanding Menu items disappearing

G

Greg

I wonder if someone would help me and take a look at a strange problem
I'm facing with a webpage I'm building. The page is at
http://author.www.purdue.edu/swo/test.html.

By using Internet Explorer v6, you will see the problem I'm having (so
far I've tested this page only in IEv6, FF2 and IE7). If you click on
the navigation menu on the left side (Alcohol, Tobacco & Other Drugs,
General Wellness, Nutrition, etc.), the menus expand. Click on the
item in the menu again and the expanded menu collapses. For some
reason in IEv6, some of the menu items (usually the lower ones)
disappear. I can't figure out why.

I'd very much appreciate anyone who takes the time to look at the
source on the page and hopefully give me an idea of why this is
happening. Also, any comments about the page would be appreciated
(suggestions, comments, things to remove or stay away from, criticism,
etc.)

By the way, what are some great browser checking sites out there. I
did some searches, but I don't really know what they are called, so I'm
not finding too much.

Thanks so much!
Greg
 
G

Greg

Please help me with this. I'm assuming it's javascript, but maybe it's
the css?

Thanks!
Greg
 
R

RobG

Greg said:
I wonder if someone would help me and take a look at a strange problem
I'm facing with a webpage I'm building. The page is at
http://author.www.purdue.edu/swo/test.html.

You will likely get better help from a CSS group, though there is a bug
with your script when clicking on the last menu item (use Firefox to
see the issue)[1].

Try:

news:comp.infosystems.www.authoring.stylesheets
<URL:
http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets/


1. The issue is with the following:

var last_obj = document.getElementById(last_expanded);
last_obj.className = "hide";

You need to check that getElementById returned a DOM object first
before trying to set a property, e.g. the following. The simple test
should be sufficient, the more rigorous approach using typeof should
not be required since getElementById should return an object or
undefined:

var last_obj = document.getElementById(last_expanded);

// Simple:
if (last_obj) last_obj.className = "hide";

// Rigorous:
if (typeof last_obj == 'object') last_obj.className = "hide";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top