Re: Center myLayer relative to scroll...
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Sun, 23 Dec 2007 10:34:48 -0800 (PST)
On Dec 23, 12:51 pm, AKS <aksus...@xxxxxxxxx> wrote:
On Dec 23, 10:30 pm, David Mark <dmark.cins...@xxxxxxxxx> wrote:
What a waste of time. No mention of any magical parseInt spells. TheMark "Tarquin" Wilton-Jones wrote:
author came up with some other incantation.
div#fixme {
left: expression( document.body.scrollLeft + 'px' );
top: expression( document.body.scrollTop + 'px' );
}
Due to a bug in Internet Explorer's interpretation of expressions,
it does not update this, so it just stayed at 0,0.
... I assigned the value to a variable, then used that to assign it to
the expression inline, it did update in Internet Explorer 5.5 and 6.
So Mark "Tarquin" Wilton-Jones chanted about a variable assignment
that supposedly works around a bug in IE6 and under. He does not
indicate why he thinks his spell works or what bug it works around.
The examples also use CSS child selector hacks, which are clearly
uneeded.
After reading his "theory", I tested my posted version in IE7 and it
worked fine without introducing a variable (or using parseInt.)
Perhaps some workaround is needed for IE6 and under, but I wouldn't
take his word for it. You might want to try it in IE6 as it would be
more efficient than calling parseInt.
But I use parseInt instead of using a global variable (and it is
possible to use eval instead of parseInt). That's all.
You certainly don't want to use eval! These expressions are evaluated
every time you move the mouse. If I had to deal with this problem, I
would start by finding out more about the bug. Is there an MS KB
article on it? If so, what is the recommended workaround? Any
workaround that requires calling eval (or parseInt) every time the
mouse moves is unacceptable.
Luckily, I don't have to deal with this problem as I wouldn't use CSS
expressions to center an element.
.
- Follow-Ups:
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- References:
- Center myLayer relative to scroll...
- From: Chris
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- From: David Mark
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- From: David Mark
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- From: David Mark
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- From: David Mark
- Re: Center myLayer relative to scroll...
- From: AKS
- Re: Center myLayer relative to scroll...
- From: David Mark
- Re: Center myLayer relative to scroll...
- From: AKS
- Center myLayer relative to scroll...
- Prev by Date: Re: Using new foo where foo is a new Foo object.
- Next by Date: How to update a label using Javascript?
- Previous by thread: Re: Center myLayer relative to scroll...
- Next by thread: Re: Center myLayer relative to scroll...
- Index(es):
Relevant Pages
|
Loading