I was programming a widget which people can embed on their sites. This
widget contains an anchor "http://www.mySite.com"; on it. I set this
anchor to the maximum integer value to prevent leechers from obscuring
the anchor. Z-index is not the only check I do for obscuring, by the
way.  So I'm stuck with using large numbers, which Safari chooses to
put in exponent form.

On Apr 1, 2:21 am, "T.J. Crowder" <[email protected]> wrote:
> +1 on Tobie's comment: Use smaller z-indexes.
>
> Scientific notation isn't hard to parse, if you want to handle it that
> way, but even that's problematic -- that number has been rounded
> (2.14748e9 == 2,147,480,000, which != 2,147,483,647), and so even
> comparing numeric values isn't going to work. Knocking a few orders of
> magnitude off your maximum z-index is probably your best bet. I mean,
> even the range 10000 through -10000 gives you a massive number
> (20,001) of vertical planes to stack...
>
> FWIW,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / comwww.crowdersoftware.com
>
> On Apr 1, 1:13 am, JoJo <[email protected]> wrote:
>
> > On all browsers but Safari, getStyle('zIndex') returns a string
> > representation of the max integer value "2147483647" for one of my
> > elements.  However, on an older version of Safari, it return the
> > exponentiated number "2.14748e+9".  After upgrading to the newest
> > Safari, it now returns "2.14748e+009", which has 2 extra zeros. Now my
> > code has broken because it does an equality check on this value.  How
> > do I future-proof my code to work for all versions of Safari? I tried
> > to use parseInt(), but this function doesn't understand exponeniated
> > numbers.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to