TRob
2 Dec 2011, 10:51 AM
This pattern seems to exist in 1.x and 2.x for animations:
curZ = el.getStyle('z-index') == 'auto' ? 0 : el.getStyle('z-index'),
... later on... some math on curZ
zIndex = curZ + 1
If I'm using z-index to achieve some interesting effects then this makes it very hard to work with. If I set z-index: 100, then rather than the animation setting it to 101 (which seems reasonable), it get's set to 1001.
Perhaps the pattern to set curZ in all the animations should be:
curZ = el.getStyle('z-index') == 'auto' ? 0 : parseInt(el.getStyle('z-index'))
curZ = el.getStyle('z-index') == 'auto' ? 0 : el.getStyle('z-index'),
... later on... some math on curZ
zIndex = curZ + 1
If I'm using z-index to achieve some interesting effects then this makes it very hard to work with. If I set z-index: 100, then rather than the animation setting it to 101 (which seems reasonable), it get's set to 1001.
Perhaps the pattern to set curZ in all the animations should be:
curZ = el.getStyle('z-index') == 'auto' ? 0 : parseInt(el.getStyle('z-index'))