File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes DHTML drop down menu - Cross Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DHTML drop down menu - Cross Browser" Watch "DHTML drop down menu - Cross Browser" New topic
Author

DHTML drop down menu - Cross Browser

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am needing some cross browser code help. I am working on a DHTML drop down menu. You can view it at http://gregg.embeddedthought.com/gthought/index.php.
In IE it works great. In Mozilla, it doesn't work at all and I don't know what I am doing that is not Netscape/Mozilla compatible.
Here is some sample code, or you can just do View Source on the link above.

Thanks for any help.
[ September 11, 2003: Message edited by: Eric Pascarello ]

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I have tried document.getElementById but either I am doing it wrong, or it is not working. It even throws an error in IE.
It says that the element I am getting is null or not an object.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
document.all is only ie
change document.all to document.getElementById
you might want to look at this script
http://www10.brinkster.com/a1ien51/JavaRanch/showhidetoggle.htm
or this one
http://www10.brinkster.com/a1ien51/JavaRanch/innerhtmltext.htm
or this one
http://www10.brinkster.com/A1ien51/basics/innerhtmlcompat.htm
Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Between my last post and your post, I figured it out. I had to use () and put the element id in ' '.
Thanks Eric.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

BTW - how do those menus look? Lame or alright?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, more problems. But these are appearntly css problems. The background image is not showing up on the Menu. And the Borders around the Menu items are not showing up. If you look at the difference between the IE version and the Mozilla version, you will see what I mean. Here is my CSS and what not.

I am going to guess that it might be with the url(...) part, but I don't know what else to use there.

Not sure why that isn't working.
Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It does not look bad, but the one thing that people might find a pain is when they move off of it, it closes right away. I have a made a menu in the past. I forgot about it until I was looking through my site for a file tonight.
http://www10.brinkster.com/a1ien51/Menus/A1ien51MenuV1.htm
I have no idea how it was coded, since I do not remember doing it, or what browsers it works in.
Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I am not 100% positive but is it the .png file? Try to use a bmp just for a quick test....I just have a weird feeling,,,or it might be my bed calling!
Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Still a no go. I will worry about it tomorrow. The bed IS calling me. Thanks for the help.
Scott Christy
Greenhorn

Joined: Sep 23, 2003
Posts: 11
In case you're interested, below is a link to a DHTML menu that works great on any platform. I've used it on the site I run for my school and it works great. You might want to check it out.
http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Scott Christy:
In case you're interested, below is a link to a DHTML menu that works great on any platform. I've used it on the site I run for my school and it works great. You might want to check it out.
http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm

Thanks for the link. Yeah, it's nice, but it's nothing exciting and it is really plain and dull (no offense intended).
That is why I am using images and CSS, to make mine a bit more pleasant to the eyes.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: DHTML drop down menu - Cross Browser