PDA

View Full Version : CSS+Javascript dropdown menu doesn’t display in MSIE.


Alex Yeh
08-30-2007, 01:29 AM
Hello, folks

I recently spent some time designing a dropdown menu that uses CSS layered divs and DOM-based javascript. I tested the CSS and XHTML against the w3c validator, and it passed the test. This menu displays beautifully in all the web-standards compliant browsers.

However, when I try looking at it on MSIE, nothing at all displays.

I realize that designing my own dropdown menu is kind of like reinventing the wheel, but it was just something I wanted to try.

Here are some links to the code involved:

The dropdown (http://www.its-lala.com/dropdown/)

The CSS (http://www.its-lala.com/dropdown/stylesheets/nav.css)

The Javascript (http://www.its-lala.com/dropdown/javascripts/dropdown.js)

Any insight would be much appreciated; thanks. :)

abduraooft
08-30-2007, 09:52 AM
Try with changing your
<script src="javascripts/dropdown.js" type="text/javascript" />
to
<script src="javascripts/dropdown.js" type="text/javascript" ></script>
and then debug problems in IE:thumbsup:
(using a combimation of <ul> and <li> would be more easier and the right way)

felgall
08-30-2007, 09:56 AM
Internet Explorer doesn't understand XHTML and so you have to write your XHTML in a way that also works as HTML if you want to use it with IE. Appendix C of the XHTML standards covers how to do it. Using </script> instead of making the tag self closing is one of the things covered there.

Alex Yeh
08-30-2007, 05:12 PM
Thanks, abduraooft and felgall - that was exactly the kind of obscure knowledge I was looking for :).