javascript - Using "bottom: expression (0+ ... ;" for IE 6 Fixed Positioning -
It seems that I'm just missing some syntax or doing wrong, but on a specific style sheet Locking remains visible on the top of the scene-port, and despite the scrolling:
top: expression (0 + ((e = document.documentElement.scrollTop)? E: document.body .scrollTop) + 'pixels');
But, it does not lock on the bottom like this:
Below: Expression (0 + ((e = document.documentElement scrollBottom) E: Document.body.scrollBottom) + 'pixels');
Any ideas?
There is no such property scrollbottom
.
Below
is the distance between the lower edge of the element located and the lower edge of the block contained. Assuming the element is not within any of the other elements located, which is an initial block containing, effectively the initial viewport in the convention.
So when the viewport scrolls down from its initial (top) position, then move down
position to negative to move it downwards Required:
// Set to script. It is more reliable than solifing for solfing. If your page has a standard mode theory, // which is really needed in this century, then you do not need it, // you can always use document.documentElement. // var root = document.compatMode === 'CSS1Compat'? Document.documentElement: document.body; / * Then: * / head: expression (root.scrollTop + 'px'); / * Or: * / below: expression (-root scrollTop + 'px');
There is still another IE6 bug where setting the bottom
style of a perfectly-positioned element is actually relative to the current viewpoint position rather than the initial viewpoint state. So in fact you will set down
to 0
all the time, even if it already has 0
...
I will not personally use expression
for anything, even an IE6 hack only. It is very unreliable, because it can not always tell when it needs recalculation. For me, I do not usually see recalculation on the scroll; Better to capture
onscroll
and onresize
. Example
Comments
Post a Comment