lcplben said:
Very sorry for the bogus post before.
ACK. Please remove it from the Google Groups archive.
The text of that link is misleading. It's a link to the W3C validator,
not any claim of mine. Thanks for picking that up.
What's an ETAGO?
(Google is your friend.¹) That's short for ETagO delimiter, End Tag Open
delimiter by which the markup parser recognizes an end tag: </
You need to escape those in a SCRIPT element for the markup to be Valid,
because its CDATA content ends there. The most simple way to escape it so
that it makes no real difference to the script engine, is <\/
(This is different in XHTML parsed by an XML parser.)
This problem appears in all of FF 3.5.3 with Firebug 1.4.3, IE7, and
Safari; under WinXP SP3.
Thanks for the information.
[...] it stands to reason that if the setFixHdr() function is called,
given a suitable runtime environment the element in question would be
formatted and the properties should yield at least the assigned values.
Yes, and now that I've I've assigned strings, not numbers, as you
suggest that part works just fine now.
However, you include a "compliance patch for microsoft browsers" script for
IE 7 and earlier, which might interfere there.
I thought that was commented out. Well, it's gone now.
Conditional Comments are considered a comment for all UAs but MSHTML, which
parses it and checks if the condition (here "IE lt 7" -- IE *6* and earlier,
sorry) applies; if yes, the rest of the comment is parsed (and rendered, if
it generates a graphical representation.) They are a way to work around
several bugs in the rather buggy MSHTML layout engine and DOM. The
Conditional Comment was probably there for a good reason; you should not
remove it without checking what it does.
For a start, assign to `innerHTML' first (or avoid `innerHTML = ""' in favor
of a while-firstChild-removeChild loop), and then assign string values, not
number values to those short-hand style properties.
I'm not familiar with the idiom "while-firstChild-removeChild loop" [...]
var o2;
while ((o2 = o.firstChild)) o.removeChild(o2);
but, yes, I understand your point.
After I applied your comments, things began to work much more as I
expect. The big change I made was this:
I was assigning values to 'top' and 'marginTop,' expecting that the
element with id = 'to' would move up and down as a result. But element
'to' is a row in a table, so that was impossible.
Ah, somehow I missed this.
The element 'to' is now a column in that table and holds the proper content.
ACK
Instead of assigning style values to the element 'to' (whose innerHTML
holds the content I want to display) I'm now trying to assign those
same style values to the table that contains it: more reasonable than
before.
But it's still not working the way I need it to. The table 'pfix' is
the direct child of <body>. When I give a 'top'/'marginTop' value to
that table, I expect it to move with respect to its parent, <body>,
and therefore /not/ move with respect to the viewport. IOW, I think
that by giving the style property the (approx) value of 'scrollTop' I
should be able to get the table to:
1. move up and down with respect to <body> and
2. remain stationary with respect to the viewport.
So: what stupid thing am I doing wrong that prevents this?
1. Make your markup Valid. For example, you need to declare HTML 4.01
*Transitional* if you want to use the `target' attribute.
2. You have a misconception about the `margin-top' CSS property (and
the `marginTop' short-hand style property). It defines the margin
between the element and the bottom margin of its previous sibling
in the same flow, if there is any; otherwise between the element
and the padding of its parent element if it is in the same flow.
However, that sibling, which would be div#no_scroll (in CSS terms),
is the child of the BODY element and the BODY element is not
positioned with regard to the viewport (but with regard to
the document.)
<
http://www.w3.org/TR/CSS21/box.html#box-dimensions>
Obviously now, you cannot expect the table to stand still because
at some point the margin width as computed from the `scrollTop'
property value must become negative, which is not defined (but has
some peculiar side effects with some layout engines with regard
to paddings and floats).
3. You can't eat the cake and have it.
Either
Forget about dynamic positioning if you want the table to move up
and down with respect to the BODY element
or
Use `position: fixed' and the readily available workaround for
IE < 7 to have the table stationary with respect to the viewport.
Lose the rest of the script code that is used for positioning.
Yes, it surely did help. Thanks very much.
You're welcome
Regards,
PointedEars
___________
¹ <
http://jibbering.com/faq/#posting>