Lee Davidson <firstname.lastname@example.org> writes:
> Thanks for your response. The objects are:
> <div id=word1 style="position:absolute; z-index=3; Left=0; top=5">
Typos in the CSS, you use "=" where you should use ":" and you
have forgotten the units on the value of top, i.e.,
<div id=word1 style="position:absolute;z-index:3;left:0px;top:5px">
In HTML 4, the type attribute is mandatory and the language attribute
> document.write("'04 election in:");
> <div id=word2 style="position:absolute; z-index:2; Left=90%; top=5">
As above. You might want to change "left:90%" to "right:0px".
> document.write(days + " Days")
I assume the "days" variable is initalized earlier.
> or actually divisions, not layers. I was lazily using a generic name.
> Sorry for the confusion.
Many people say "layers" about absolutely positionend block elements.
I try to make them stop, partly because it can be confuzed with the
<layer> tag, but mostly because it makes people think that there is
something special about the positioned block. In CSS, it's just a
block like any other.
> I had printed the values to the screen so I know the various flags are
> set correctly (at least NS6 and IE) as I'm using NS7.
> I doubt many people are using NS4 anymore, but I left that in just
> because it wasn't hurting anything.
As long as it isn't used for anything but NS4, it shouldn't be a
> I used your wonderful page (please keep it around a while) to see that
> document.body.clientWidth returns the value in both IE and NS. But
> when I try to display it with an alert box:
> <BODY onload="init()">
(yes, I'm pedantic :)
> var scrWidth = document.body.clientWidth;
> alert("sw " + scrWidth);
> it comes up as 0.
I can't explain (or reproduce) that. Do you have a link to the page?
Does the page set the broweser in Quirks mode or Standards mode? I
test the values in Standards mode (the only mode one should write new
pages for!), and it might make a difference.
Some value are not initialized until the page is loaded, or at least
contains some content. Your example here gets
document.body.clientWidth before any content is added to the body. I
don't think it matters, it's the height that has that problem, not the
I don't think that is the problem, though (can't reproduce a problem
with it in either Standards or Quirks mode.)
> So all the math is failing and the move not reached. I do see the
> proper number when your page is displayed in NS so I know the
> browser does see the width.
I'm pretty stumped too. Could you give a link to the page, so I can
see it live?
> Now you know why I'm losing my hair.
I hear testosterone will do that to you. That's my excuse :)
Lasse Reichstein Nielsen - email@example.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'