Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DHTML drop down menu - Cross Browser

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW - how do those menus look? Lame or alright?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still a no go. I will worry about it tomorrow. The bed IS calling me. Thanks for the help.
 
Scott Christy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic