CSS positioning unit

They have: 297 posts

Joined: Apr 1999

Hi,

I noticed that IE gives you the position of a CSS element is this form: "2XX px" as a string with the unit px, so you cant calculate with it. NS doesnt do this.

Can somebody give me a little script to remove the " px" from the string and return the number?

Thank You,

Malte

------------------
Malte Ubl - www.Boardzilla.org
Communication: public<->programmers
of the Boardzilla BB

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

This should work:

variable=parseInt(document.whatever);

They have: 297 posts

Joined: Apr 1999

Thanx,

looks pretty easy

Malte

------------------
Malte Ubl - www.Boardzilla.org
Communication: public<->programmers
of the Boardzilla BB

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.