Forum Moderators: open
Unfortunately I don't know my javascript, but I've used dreamweaver to create a main menu for my site.
It's a nice simple dropdown menu that highlights when you roll over it, drops down the sub menus, and any sub menus of those when you roll over the appropriate bit. The usual I'm sure!
My problem is that in Firefox it all looks utterly fabulous, perfect, and well formatted. Flawless.
In IE of course, the menu is curiously mis-positioned, the dropdown effect seems to rise up the screen instead where it can, and any sub menus off sub menus appear disjointed from the rest of the menu in very strange positioning. I'm very confused.
I looked up some other free js dropdown menus to see if it was perhaps the script (although the script I used came with dreamweaver as standard). I haven't tried any other scripts yet as it seems so illogical, but I'm sure I read on one of my searches that one of said free menu scripts may not display properly unless the code was called from within the body tag as opposed to the head. Does this really make a difference? If so, why!?
Any help would be great. I'm so tempted to just push nice clean free organic Firefox on my site, but I shouldn't have to in order for people to see the thing properly, isn't that the ultimate design sin haha?
Thanks,
Mr Cat
The reason is that many well structured scripts will rely on proper functioning of CSS. If your code is invalid, it will render in Quirks mode and some of the CSS may fail, which will cause your Javascript to render something Picasso-like. In FireFox, right-click on some background area and select View Page Info, you will see the item for Render Mode.
I've used dreamweaver to create a main menu for my site.
If it's the stock code output by Dreamweaver, others may be of help - but I've never had luck working with those. Too much legacy reliance on browser identification, buggy as can be . . . try looking at replacing it with a cleaner CSS-only or JS menu sample from the web.
. . . said free menu scripts may not display properly unless the code was called from within the body tag as opposed to the head.
There are a variety of reasons, the *most likely* being that all the JS and the page elements it references needs to load before it will work, and this is one way to do that:
<body onLoad="callYourInit();">
A workaround for IE used to be to put this before the closing </body> tag instead, that way all the referenced page objects are loaded before it calls the init. Key word, workaround.
A cleaner way without munging up the body tag is to put this in your external Javascript file (or inline in the <script> block in the head:)
window.onload=function () { callYourInit(); }