Forum Moderators: open
What I want is to have it fixed at left, and tried several things, position fixed with an javascript for IE, but that java force me to use: <!-- //forcing quirks mode: -->, and I canīt use that, I need margin:auto for my site.
So if anybody knows some script for giving it exact position, always on top at left, or any links how to do it myself easily, I would apprecate that.
And that wonīt give an big .js file.
Before had an .js menu, but changed it to this css menu, though it was 35 kbs.
Thanks in advance
onload = function(){
if(document.getElementById &&!window.getComputedStyle){// DOM but not Mozilla
document.getElementById("left").style.position = "absolute";
window.onscroll = reposicionaMenu;
}
}
</script>
but to use it I need to use: <!-- //forcing quirks mode: -->
and I cant do that, I need to use margin:auto, wich doesnīt work in quirks mode :)
this is another mode to do without using position fixed: [tierradenomadas.com...]
but that only simply layouts, and the same you canīt use margin:auto.
Please, check my profile, and you can see that the menu is very diferent, in fact, donīt think many done it that way yet, though it sort of new,
but will try in css forum as well.
In case you still need JavaScript:
1. call your menu 'myMenu'
1. use #myMenu {position: fixed;} for non-IE
2. add this below your CSS-code:
<!--[if IE gte 5 ]>
<style type="text/css">
#myMenu {position: absolute; }
</style>
<![endif]-->
<!--[if IE gte 5 ]>
<script language="JScript">
if (document.recalc && document.body.attachEvent) {
myMenu.style.setExpression("top", "document.body.scrollTop + 150");
document.body.onscroll=function(){document.recalc(true)};
}
</script>
<![endif]-->
Yes JavaScript can do this. But it's always unplesantly flickery. Personally I don't like menus that do this. Nevertheless, there are many scripts available on the internet and it has been discussed many times on this site too.
Another way would be to use frames, but frames are bad so I wouldn't do that either.
ADDED AT EDIT:
There are some other (non-JavaScript) hacks to get around IE's lack of position:fixed; support.
[devnull.tagsoup.com...]