Getting computed/current style

G

Garrett Smith

David said:
Garrett said:
David said:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
Eric Bednarz wrote:
[snip a bunch of noise]

You truly are hopeless. You really should be following me ("cinsoft" on
Twitter). Good luck with the FAQ. :)
I don't have much interest in following someone who cannot explain the
reason for his own code (but keep up the marketing and you're bound to
get some fool who will).

Once again, you are blind. Good luck with that!
No, I am not blind.

You posted a suggestion to use offsetLeft and offsetTop to check the
work of setting top and left values. That sort of feature test cannot
work reliably, as offsetTop being nonstandard features that define what
would be the "expected" value.

| And now for the cunning bit. Compare the new offsetLeft/Top property
| values to the old. If they are the same, you "guessed" right. If
| they are off, vive la difference!

That test would be then expressed as `doesPositionStyleAffectOffset`.
Now if there is a point to performing such test, it has not been stated
by you nor by anyone else.

If there is no point to that code, then I would suggest it's removal
from wherever it exists.

It does not seem to answer your proposed question: "How do I get the
current left/top/right/bottom/height/width/etc. styles?"

Nor am I hopeless. Annoyed, yes, a little annoyed.
 
D

David Mark

Garrett said:
David said:
Garrett said:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
Eric Bednarz wrote:
[snip a bunch of noise]

You truly are hopeless. You really should be following me
("cinsoft" on
Twitter). Good luck with the FAQ. :)
I don't have much interest in following someone who cannot explain the
reason for his own code (but keep up the marketing and you're bound to
get some fool who will).

Once again, you are blind. Good luck with that!
No, I am not blind.

You've been acting like you can't see the forest for the trees with
numerous suggestions of mine. It's been going on for years.
You posted a suggestion to use offsetLeft and offsetTop to check the
work of setting top and left values. That sort of feature test cannot
work reliably, as offsetTop being nonstandard features that define what
would be the "expected" value.

You still don't get it and I don't care. Dig a little deeper. Twitter
has the links you need (or just visit my home page). ;)
| And now for the cunning bit. Compare the new offsetLeft/Top property
| values to the old. If they are the same, you "guessed" right. If
| they are off, vive la difference!

That test would be then expressed as `doesPositionStyleAffectOffset`.
Now if there is a point to performing such test, it has not been stated
by you nor by anyone else.

Wrong. We've had this discussion more than once. I've all but spelled
it out here. Now I have spelled it out (in code) on my site.
If there is no point to that code, then I would suggest it's removal
from wherever it exists.

You aren't in a position to suggest removing code you clearly don't
understand.
It does not seem to answer your proposed question: "How do I get the
current left/top/right/bottom/height/width/etc. styles?"

Asked and answered.
Nor am I hopeless. Annoyed, yes, a little annoyed.

Join the club. Starting with isHostMethod, then viewport measurement
and now this (and many in between). I'm tired of revisiting the same
"arguments" over and over.
 
G

Garrett Smith

David said:
Garrett said:
David said:
Garrett Smith wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
Eric Bednarz wrote:
[snip a bunch of noise]

You truly are hopeless. You really should be following me
("cinsoft" on
Twitter). Good luck with the FAQ. :)
I don't have much interest in following someone who cannot explain the
reason for his own code (but keep up the marketing and you're bound to
get some fool who will).
Once again, you are blind. Good luck with that!
No, I am not blind.

You've been acting like you can't see the forest for the trees with
numerous suggestions of mine. It's been going on for years.
Huh.

[...]

Wrong. We've had this discussion more than once. I've all but spelled
it out here. Now I have spelled it out (in code) on my site.

As with Twitter: That is your business.

Although I find value in the *concept* of twitter, the UI is not worth
wrangling with. I have decided that it is not worth the frustration of
trying to use Twitter UI. I am just not that interested in broadcasting
to many people. I figure that the smart folks will find there way here
and the same folks who are promulgating the same bad practices that have
crap-flooded the industry with will flounder with their pop websites
(like Twitter).

Many of these individuals become millionaires by being involved in
trendy projects that sell. They sell despite the "engineering" with code
that seems incongruous with that term.

What happens here on c.l.js is public discussion. If there is a good
reason for that test, such as a case where it helps find style value in
a particular situation, I haven't seen anybody posting it.
You aren't in a position to suggest removing code you clearly don't
understand.

No, c.l.js is the right place to discuss these things. You can advertise
your twitter homepage or website or library, but those are not places
for open discussion. Here, there is free discussion.

If I am missing a point (a good reason) for determining
`doesPositionStyleAffectOffset` or whatever it should be called, then it
hasn't been made clear what that is.
Asked and answered.

The way to read styles is for browsers that implement ViewCSS, use
defaultView.getComputedStyle(obj, pseudoClass), and for IE, to use
currentStyle.

Both of those APIs are problematic. Some massaging is usually required,
both of the style values in the CSS and of the values returned, to get
consistent results.

This is an issue I've had to deal with a lot over the years and I do not
have a simple solution. You also suggested Eric to use "My Library" and
that is not going in the FAQ.
Join the club. Starting with isHostMethod, then viewport measurement
and now this (and many in between). I'm tired of revisiting the same
"arguments" over and over.

OK, I think I see where you're coming from. I looked at each argument
separately, not as the same thing.

I agree that there is value in having a good simple answer to the
question. The problem is that the question can't be answered so simply.
Reading style values is a simple thing to want to do but a general
solution to solve for that is not going to be simple.
 
D

David Mark

Garrett said:
David said:
Garrett said:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
David Mark wrote:
Garrett Smith wrote:
Eric Bednarz wrote:
[snip a bunch of noise]

You truly are hopeless. You really should be following me
("cinsoft" on
Twitter). Good luck with the FAQ. :)
I don't have much interest in following someone who cannot explain the
reason for his own code (but keep up the marketing and you're bound to
get some fool who will).
Once again, you are blind. Good luck with that!
No, I am not blind.

You've been acting like you can't see the forest for the trees with
numerous suggestions of mine. It's been going on for years.
Huh.

[...]

Wrong. We've had this discussion more than once. I've all but spelled
it out here. Now I have spelled it out (in code) on my site.

As with Twitter: That is your business.

My point was I made the information available after the initial
confusion. You should keep up with my site anyway as it is full of
useful information.
Although I find value in the *concept* of twitter, the UI is not worth
wrangling with.

Yes, the Web UI is a jQuery. Enough said. :(
I have decided that it is not worth the frustration of
trying to use Twitter UI. I am just not that interested in broadcasting
to many people.

That's your choice. I put up with it as it is great for generating
traffic, which begets more traffic, which begets contract offers. ;)
I figure that the smart folks will find there way here
and the same folks who are promulgating the same bad practices that have
crap-flooded the industry with will flounder with their pop websites
(like Twitter).

I figured that once too. People seem to gravitate to the crap-ola. If
it has pretty graphics, it must be good! :)
Many of these individuals become millionaires by being involved in
trendy projects that sell. They sell despite the "engineering" with code
that seems incongruous with that term.

Yes. Take Google, which throws exceptions on virtually every page in
the _latest_ Opera (a very standards-compliant browser of course). It's
all browser sniffing madness.
What happens here on c.l.js is public discussion. If there is a good
reason for that test, such as a case where it helps find style value in
a particular situation, I haven't seen anybody posting it.

That's because (like many of my points on feature testing), nobody seems
to have thought of it (except Richard of course, who I assume is amused
that I with what I have built on top of many of his original ideas).
No, c.l.js is the right place to discuss these things. You can advertise
your twitter homepage or website or library, but those are not places
for open discussion. Here, there is free discussion.

I was just trying to point you to some example code that I posted.
If I am missing a point (a good reason) for determining
`doesPositionStyleAffectOffset` or whatever it should be called, then it
hasn't been made clear what that is.


The way to read styles is for browsers that implement ViewCSS, use
defaultView.getComputedStyle(obj, pseudoClass), and for IE, to use
currentStyle.

Not in many cases (e.g. left/top/right/bottom/height/width). First
there are lots of bugs, second IE won't return _anything_ unless there
is a corresponding declaration (and even then, it may not be in a
convenient format). That's why you have to balance the equation with
offset* properties. You don't have to take my word for it. Try out my
examples. I've tested in IE5.5-8 (all modes), Opera 7-10, FF1-3.6,
Chrome 3/4, Safari 4.0, an iPhone and several other odd agents. If you
get the equations right (which I knew I did for at least
left/top/height/width), you really can't go wrong (math is math).

Contrast that to what the "majors" do, which is often confused or even
completely backwards (e.g. jQuery's ridiculous "smoothing over" of box
model differences, which sometimes results in unusable dimensions).
Then there's that crazy MacGuyver hack, which I hate to say is actually
in My Library as well. Like I said, the simplified examples that I am
posting now (e.g. viewport, size, position, keyboard) will eventually
supplant the more complicated routines in My Library.
Both of those APIs are problematic. Some massaging is usually required,
both of the style values in the CSS and of the values returned, to get
consistent results.

I've got it down to s science (and have since around 2007).
This is an issue I've had to deal with a lot over the years and I do not
have a simple solution. You also suggested Eric to use "My Library" and
that is not going in the FAQ.

Who said it should; however, it seems idiotic to link to PrototypeJS and
not My Library.
OK, I think I see where you're coming from. I looked at each argument
separately, not as the same thing.

As you should have, but each time it was like you went off the course
for no good reason.
I agree that there is value in having a good simple answer to the
question. The problem is that the question can't be answered so simply.

What question?
Reading style values is a simple thing to want to do but a general
solution to solve for that is not going to be simple.

That's what you think. :)
 
E

Eric Bednarz

Garrett Smith said:
Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".

“Offsetâ€, to CSS 2.1, is about section 9.3.2.

(Unfortunately I had to move that:)

What I do not understand is the "expected" column. What are the
expectations coming from?

See above; is the specification (candidate) an unreasonable point of
reference?
To retrieve element coordinate offsets with jQuery,

Anybody who understands the difference between relative and absolute
positioning should be able to understand why I am having a hard time to
understand this persistant fixation on wanting to get element
coordinates in respect to anything else but that element’s position in
the normal flow.
jQuery's offset
method would be the method for that.

I want to retrieve CSS values, and jQuery (as do some other libraries)
pretends to provide a method to do that; unsurprisingly, the cross
browser proposition is restricted to a tiny subset of the possible use
cases.
 
E

Eric Bednarz

David Mark said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary. ^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';

Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).
 
D

David Mark

Eric said:
Garrett Smith said:
Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".

“Offsetâ€, to CSS 2.1, is about section 9.3.2.

(Unfortunately I had to move that:)

What I do not understand is the "expected" column. What are the
expectations coming from?

See above; is the specification (candidate) an unreasonable point of
reference?
To retrieve element coordinate offsets with jQuery,

Anybody who understands the difference between relative and absolute
positioning should be able to understand why I am having a hard time to
understand this persistant fixation on wanting to get element
coordinates in respect to anything else but that element’s position in
the normal flow.
jQuery's offset
method would be the method for that.

I want to retrieve CSS values, and jQuery (as do some other libraries)
pretends to provide a method to do that; unsurprisingly, the cross
browser proposition is restricted to a tiny subset of the possible use
cases.

My Library's is pretty good. The one in the new primer (see my site) is
better.
 
D

David Mark

Eric said:
David Mark said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary. ^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';

Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).

Nope. Works like a charm for relative and fixed. Why wouldn't it?
 
D

David Mark

David said:
Eric said:
David Mark said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary. ^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';
Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).

Nope. Works like a charm for relative and fixed. Why wouldn't it?

And it does appear you are missing (snipped?) the latter part of the
explanation. Remember when I said to check if it moved. That's the
key. Again, vive la différence! :)
 
D

David Mark

David said:
David said:
Eric said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary.
^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';
Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).
Nope. Works like a charm for relative and fixed. Why wouldn't it?

And it does appear you are missing (snipped?) the latter part of the
explanation. Remember when I said to check if it moved. That's the
key. Again, vive la différence! :)

Yep. Immediately following the cited bit was this paragraph. Without
it, the above makes no sense. Did you stop reading at that point? :)

"And now for the cunning bit. Compare the new offsetLeft/Top property
values to the old. If they are the same, you "guessed" right. If they
are off, vive la difference! ;)"
 
G

Garrett Smith

Eric said:
David Mark said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary. ^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';

Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).
What for? It would provide proof that setting left and top values
changes offsetTop and offsetLeft, respectively. That hardly seems worth
trying to prove, though.
 
D

David Mark

Garrett said:
Eric said:
David Mark said:
Here's the thing. You can make use of offsetLeft/Top to check your
work. For instance, take your relative position quandary. ^^^^^^^^
OK.

[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';

Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).
What for? It would provide proof that setting left and top values
changes offsetTop and offsetLeft, respectively. That hardly seems worth
trying to prove, though.

Jesus wept. It's a tag team of bad snipping plus following up without
reading prior posts (from _today_ no less!)

From a post earlier today decrying the odd snipping, which destroyed the
context of the above:-

"Yep. Immediately following the cited bit was this paragraph. Without
it, the above makes no sense. Did you stop reading at that point? :)

"And now for the cunning bit. Compare the new offsetLeft/Top property
values to the old. If they are the same, you "guessed" right. If they
are off, vive la difference! ;)""

....so now I am quoting myself quoting myself. If this sort of shit
keeps up, I'll be checking out of Usenet for good. It's too irritating.
 
E

Eric Bednarz

David Mark said:
David said:
Eric said:
[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';
Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).

Nope. Works like a charm for relative and fixed. Why wouldn't it?

And it does appear you are missing (snipped?) the latter part of the
explanation.

I didn’t miss it, I didn’t think it through properly; it is obvious that
you still have to do something after the above whithout comprehensively
quoting the rest of your message[0], so please don’t blame other
people’s simplemindedness on me, it’s hard enough to be responsible for
my own.
Remember when I said to check if it moved. That's the
key. Again, vive la différence! :)

Multiplying the first offsetTop/Left value by 2 and substracting the
second one does indeed result in the (computed pixel-) value of the
offset property. Sometimes I’m a bit slow (posting after three in the
morning doesn’t help much :). Thanks.


[0] cf. <http://www.cs.tut.fi/~jkorpela/usenet/laws.html#law22>
 
D

David Mark

Eric said:
David Mark said:
David said:
Eric Bednarz wrote:
[…] grab the offsetLeft and offsetTop (verify
beforehand that they are available and numbers of course) then set the
left and top styles to those. Simply put:-

var offsetLeft = el.offsetLeft;
var offsetTop = el.offsetTop;

el.style.left = offsetLeft + 'px';
el.style.top = offsetTop + 'px';
Unless I miss someting, that strategy is only useful for absolute
positioning (I like it, and I use it, in that context).
Nope. Works like a charm for relative and fixed. Why wouldn't it?
And it does appear you are missing (snipped?) the latter part of the
explanation.

I didn’t miss it, I didn’t think it through properly; it is obvious that
you still have to do something after the above whithout comprehensively
quoting the rest of your message[0], so please don’t blame other
people’s simplemindedness on me, it’s hard enough to be responsible for
my own.

Fair enough. :)
Multiplying the first offsetTop/Left value by 2 and substracting the
second one does indeed result in the (computed pixel-) value of the
offset property. Sometimes I’m a bit slow (posting after three in the
morning doesn’t help much :). Thanks.

NP. Glad to help!
 
G

Garrett Smith

Eric said:
Garrett Smith said:
Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".

“Offsetâ€, to CSS 2.1, is about section 9.3.2.

"offset" is a prefix for three nasty properties and one good property.
The nasties are: offsetLeft, offsetTop, and offsetParent. The one good
one is offsetWidth.

Those are defined in CSSOM Views, and, depending on the version of that
document, you'll get completely different definitions for the bad ones.
The implementations of IE 6-8 are all different. Likely IE9 will be
different again. Of course other browsers all vary on what they do for
those properties as well.

If you're trying to obtain element coordinates, relative to the root,
method getBoundingClientRect (also specified in CSSOM Views) does that.
(Unfortunately I had to move that:)



See above; is the specification (candidate) an unreasonable point of
reference?


Anybody who understands the difference between relative and absolute
positioning should be able to understand why I am having a hard time to
understand this persistant fixation on wanting to get element
coordinates in respect to anything else but that element’s position in
the normal flow.

It is unclear when you write "position" what you mean. Do you mean "top"
and "left" values or is it something else?
I want to retrieve CSS values, and jQuery (as do some other libraries)
pretends to provide a method to do that; unsurprisingly, the cross
browser proposition is restricted to a tiny subset of the possible use
cases.

Use getComputedStyle for ViewCSS and currentStyle for IE to get that. It
is going to be limited to what the browsers can do. In some cases, you
will find browser returning "auto" or worse -- when querying "left"
value, you'll get a value that corresponds to that element's marginLeft.

To get around that issue, the stylesheet will need a left value.

The dfference of IE current style is even greater.
 
D

David Mark

Garrett said:
Eric said:
Garrett Smith said:
Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".

“Offsetâ€, to CSS 2.1, is about section 9.3.2.

"offset" is a prefix for three nasty properties and one good property.
The nasties are: offsetLeft, offsetTop, and offsetParent. The one good
one is offsetWidth.

Are you abstaining on offsetHeight? And BTW, the nasties can be very
useful if you know how to train them. See the final resolution of this
thread. ;)
Those are defined in CSSOM Views, and, depending on the version of that
document, you'll get completely different definitions for the bad ones.

They are written about in there, but that was after the fact, so
whatever is written is just trying to explain what has already happened.
It won't change reality retroactively and it remains to be seen if that
_draft_ will ever be finished and formally approved.
The implementations of IE 6-8 are all different.

Which doesn't matter a whit for the case at hand.
Likely IE9 will be
different again.

And that won't matter either. Basic math is unassailable.
Of course other browsers all vary on what they do for
those properties as well.

Not that much. In many contexts, the results are quite predictable
(even when not using equations that factor out the discrepancies). I've
managed to do some truly useful things with these properties over the
years, but all you seem to do is complain about them and cite daffy W3C
drafts.
If you're trying to obtain element coordinates, relative to the root,
method getBoundingClientRect (also specified in CSSOM Views) does that.

Fairly well. Of course obtaining such coordinates relative to the root
is ill-advised and virtually always unnecessary (consider that fact at
the design stage).
It is unclear when you write "position" what you mean. Do you mean "top"
and "left" values or is it something else?

I believe he wants one from each of top/bottom and left/right.
Use getComputedStyle for ViewCSS and currentStyle for IE to get that.

Wrong again. (!) Do me a favor and read the thread to its conclusion
before posting any more (or just let it lie as it is done).
It
is going to be limited to what the browsers can do.

That's your self-imposed limitation, which seems to be the result of
blinders. :(
In some cases, you
will find browser returning "auto" or worse -- when querying "left"
value, you'll get a value that corresponds to that element's marginLeft.

What a blow for you. :)
To get around that issue, the stylesheet will need a left value.
Wrong.


The dfference of IE current style is even greater.

Yeah, you will have to deal with non-pixel units and the aforementioned
requirement of explicitly declaring the position in a style sheet.
That's all and it is all unnecessary.

If you pursue this direction further into the weeds, I am just going to
go ballistic. It's almost like you are being deliberately loopy (and
that pisses me off as I don't care to have to clear up what you
obscure). Leave it alone. We're cone here. Thanks for your attempts
to help.
 
G

Garrett Smith

David said:
Garrett said:
Eric said:
Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".
“Offsetâ€, to CSS 2.1, is about section 9.3.2.
"offset" is a prefix for three nasty properties and one good property.
The nasties are: offsetLeft, offsetTop, and offsetParent. The one good
one is offsetWidth.

Are you abstaining on offsetHeight? And BTW, the nasties can be very
useful if you know how to train them. See the final resolution of this
thread. ;)

Looking down further...
They are written about in there, but that was after the fact, so
whatever is written is just trying to explain what has already happened.
It won't change reality retroactively and it remains to be seen if that
_draft_ will ever be finished and formally approved.


Which doesn't matter a whit for the case at hand.


And that won't matter either. Basic math is unassailable.

Is it here?
Not that much. In many contexts, the results are quite predictable
(even when not using equations that factor out the discrepancies). I've
managed to do some truly useful things with these properties over the
years, but all you seem to do is complain about them and cite daffy W3C
drafts.


Fairly well. Of course obtaining such coordinates relative to the root
is ill-advised and virtually always unnecessary (consider that fact at
the design stage).


I believe he wants one from each of top/bottom and left/right.

Interesting.

I would probably rather figure out if that is correct, and why, before
claiming a final resolution.

[...]
If you pursue this direction further into the weeds, I am just going to
go ballistic. It's almost like you are being deliberately loopy (and
that pisses me off as I don't care to have to clear up what you
obscure). Leave it alone. We're cone here. Thanks for your attempts
to help.

I am trying to get to the heart of the problem.

Making threats to "go ballistic" is childish. And I don't think you'd
get very far with that if we met in person :-D.
 
D

David Mark

Garrett said:
David said:
Garrett said:
Eric Bednarz wrote:

Eric Bednarz wrote:
Since I never attempted to retrieve offset values of relatively
positioned elements by script, […]
"Offset" values and top/left style values are different
things.
Ah.

Offset", to me, is about the badly defined and highly
inconsistent "offsetTop", "offsetLeft", and "offsetParent".
“Offsetâ€, to CSS 2.1, is about section 9.3.2.

"offset" is a prefix for three nasty properties and one good property.
The nasties are: offsetLeft, offsetTop, and offsetParent. The one good
one is offsetWidth.

Are you abstaining on offsetHeight? And BTW, the nasties can be very
useful if you know how to train them. See the final resolution of this
thread. ;)

Looking down further...

Did you spot anything?
Is it here?

No question. Seriously, read the thread from start to finish (and
perhaps the last one we had on this topic) and then go look at the
answers on my site (position primer) if you can't spot the pattern.
Interesting.

Not really. One from each is how you position an element (without
affecting its size). See Eric's original test page as it would seem the
best indicator of what he's trying to do.
I would probably rather figure out if that is correct, and why, before
claiming a final resolution.

He "claimed" the final resolution. Did you finish reading the thread or
not? This is getting ridiculous.
[...]
If you pursue this direction further into the weeds, I am just going to
go ballistic. It's almost like you are being deliberately loopy (and
that pisses me off as I don't care to have to clear up what you
obscure). Leave it alone. We're cone here. Thanks for your attempts
to help.

I am trying to get to the heart of the problem.

So far, you _are_ the problem.
Making threats to "go ballistic" is childish. And I don't think you'd
get very far with that if we met in person :-D.

Talk about childish. Gee, what would you do mister body-builder? Give
me a fucking break.
 
G

Garrett Smith

David said:
[...]
I am trying to get to the heart of the problem.

So far, you _are_ the problem.
No, the problem is related to getting computed/current style. Before
jumping to conclusions on the final answer, the problem description
needs more detail.

The detail needed is: (1)what specifically is wanted and (2)why/what
situation (what is the OP trying to do).

We also need clarification on terminology for "offset".
Talk about childish. Gee, what would you do mister body-builder? Give
me a fucking break.
"Going ballistic" has nothing to do with technical discussion. It is
personal, irrelevant noise. Just like your "final solution" is more
about your ego than the OP's actual problem.

"Argument From Intimidation" doesn't have any place in a technical
discussion (of programming).
 
D

David Mark

Garrett said:
David said:
Garrett said:
David Mark wrote:
Garrett Smith wrote:
Eric Bednarz wrote:

Eric Bednarz wrote:
[...]
I am trying to get to the heart of the problem.

So far, you _are_ the problem.
No, the problem is related to getting computed/current style. Before
jumping to conclusions on the final answer, the problem description
needs more detail.

The detail needed is: (1)what specifically is wanted and (2)why/what
situation (what is the OP trying to do).

We also need clarification on terminology for "offset".
Talk about childish. Gee, what would you do mister body-builder? Give
me a fucking break.
"Going ballistic" has nothing to do with technical discussion.
So?

It is
personal, irrelevant noise.

So are you. :)
Just like your "final solution" is more
about your ego than the OP's actual problem.

Don't be a loser. The OP seemed to like it, as have numerous others who
have read the position primer on my site. This is all about your
rapidly deflating ego. ;)
"Argument From Intimidation" doesn't have any place in a technical
discussion (of programming).

Oh shut up before I plonk you. :) You really are on my last nerve.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top