Created
July 31, 2012 00:41
-
-
Save tonylukasavage/3212321 to your computer and use it in GitHub Desktop.
zIndex doesn't animate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow({ | |
backgroundColor: '#fff', | |
fullscreen: false, | |
exitOnClose: true | |
}); | |
var view1 = Ti.UI.createView({ | |
height: 200, | |
width: 200, | |
left: 30, | |
top: 30, | |
backgroundColor: '#00a', | |
opacity: 0.5, | |
zIndex: 1 | |
}); | |
var view2 = Ti.UI.createView({ | |
height: 200, | |
width: 200, | |
left: 10, | |
top: 10, | |
backgroundColor: '#a00', | |
opacity: 0.25, | |
zIndex: 2 | |
}); | |
var view3 = Ti.UI.createView({ | |
height: 200, | |
width: 200, | |
left: 10, | |
top: 10, | |
backgroundColor: '#a00', | |
opacity: 0.25, | |
zIndex: 3 | |
}); | |
var view4 = Ti.UI.createView({ | |
height: 200, | |
width: 200, | |
left: 10, | |
top: 10, | |
backgroundColor: '#a00', | |
opacity: 0.25, | |
zIndex: 4 | |
}); | |
win.add(view1); | |
win.add(view2); | |
win.add(view3); | |
win.add(view4); | |
win.open(); | |
win.addEventListener('click', function(e) { | |
var anim = Ti.UI.createAnimation({ | |
duration: 4000, | |
zIndex: 5 | |
}); | |
anim.addEventListener('complete', function(e) { | |
alert('done'); | |
}); | |
view1.animate(anim); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment