[thelist] image position without using CSS?
Peter-Paul Koch
gassinaumasis at hotmail.com
Fri Dec 14 04:18:50 CST 2001
>Here's a reply that I gained from the folks at webdesign-l.com earlier
>today.
>
>"DOM gives you no access to the current positions of things. What you can
>access in DOM is *only* what you specified as part of the document/
>stylesheet."
That is correct. However, there's more in a browser than the DOM. The offset
properties aren't standardized and will never be part of the DOM, but
they're there, ready for use.
So no, this is not part of the DOM, but yes, it works (just like for
instance resizeTo(), it has nothing to do with the document or the DOM but
all browsers support it)
>I was using this response as the basis for a forward-compatible script
>(which interacts with CSS). Perhaps I misread it?
You don't need to interact with the CSS. In fact, the trick is that you
don't refer to the CSS at all, but only to the actual position of the
element in the window. You use the DOM only to name the element, then you
use the non-DOM offset properties to calculate its position.
The JavaScript browser environment consists of more than the DOM, though
admittedly it's the single most important module.
ppk
> > Von: "Peter-Paul Koch" <gassinaumasis at hotmail.com>
> >
> >> Hmm... So what you are saying, Mark, is that you cannot get the
> >> position of an image or other element without having previously
> >> set a location for that element with CSS?
> >
> > Maybe he tried to say that, but it is NOT true.
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
More information about the thelist
mailing list