T
The Natural Philosopher
I've spent nearly two days and I cannot resolve this.
All I want to do is compare the z-index of an element with an argument
passed to a function. If its greater than the argument plus one, I want
the test to pass.
In firefox/safari, this works
if ((level+1) <sample.style.zIndex )
In IE7 it doesn't.
I can mimic the same behaviour in safari/firefox IE7 by explicitly
casting the objects to numbers using 'Number()'
i.e
if (Number(level+1) <Number(sample.style.zIndex) )
fails equally on all platforms.
So does
if ((Number(level)+1) <Number(sample.style.zIndex) )
So does
if ((Number(level)+1) < (sample.style.zIndex))
so does
if (++level <sample.style.zIndex )
and
if ((++level) < sample.style.zIndex)
I am sure I am missing something glaringly obvious, so please enlighten me.
All I want to do is compare the z-index of an element with an argument
passed to a function. If its greater than the argument plus one, I want
the test to pass.
In firefox/safari, this works
if ((level+1) <sample.style.zIndex )
In IE7 it doesn't.
I can mimic the same behaviour in safari/firefox IE7 by explicitly
casting the objects to numbers using 'Number()'
i.e
if (Number(level+1) <Number(sample.style.zIndex) )
fails equally on all platforms.
So does
if ((Number(level)+1) <Number(sample.style.zIndex) )
So does
if ((Number(level)+1) < (sample.style.zIndex))
so does
if (++level <sample.style.zIndex )
and
if ((++level) < sample.style.zIndex)
I am sure I am missing something glaringly obvious, so please enlighten me.