On May 16, 2:08 pm, juergen.rie...@ gmail.com wrote:
following code does not render scrollbars in firefox 1.5.x. Bug?
Workaround other than to innerHTML an absolute positioned element
after loading?
That's what I do and it's reliably calculated the scrollbar size on
NS6,7,8,FF etc. Try this (which declares a global called
ScrollbarOffset ):
window.onload=f unction(){
var outerdiv=docume nt.createElemen t("div");
outerdiv.style. position="absol ute";
outerdiv.style. top="0px";
outerdiv.style. left="0px";
outerdiv.style. width="50px";
outerdiv.style. height="50px";
outerdiv.style. overflow="hidde n";
var innerdiv=docume nt.createElemen t("div");
innerdiv.style. width="100%";
innerdiv.style. height="60px";
outerdiv.append Child(innerdiv) ;
document.body.a ppendChild(oute rdiv);
var noscrolloffset= innerdiv.offset Width;
outerdiv.style. overflow="auto" ;
var withscrolloffse t=innerdiv.offs etWidth;
document.body.r emoveChild(docu ment.body.lastC hild);
ScrollbarOffset =noscrolloffset-withscrolloffse t;
}