None

doctype and javascript in ie6.x

i was trying to re-use some old sliding menu javascript today and for some reason it just refused to work. can you guess why?

function DoMoveIt()
{
  document.all.leftmenubar.style.top = document.body.scrollTop + 100;
  setTimeout("DoMoveIt()",5);
}


well it foxed me for half an hour anyway. according to this page, when you define a doctype in your html, ie6 will move a load of javascript properties from document to document.documentElement. so the working function looks like this...

function DoMoveIt()
{
  if (document.documentElement && document.documentElement.scrollTop)
    theTop = document.documentElement.scrollTop;
  else if (document.body)
    theTop = document.body.scrollTop;
  document.all.leftmenubar.style.top = theTop + 100;
  setTimeout("DoMoveIt()",5);
}