I'm new in titanium and I have a strange problem with animate, the code is like this.
var animateRight = Ti.UI.createAnimation({
left : 150,
curve:Titanium.UI.ANIMATION_CURVE_EASE_IN_OUT
});
var animateStart = Ti.UI.createAnimation({
left : 0,
curve:Titanium.UI.ANIMATION_CURVE_EASE_IN_OUT
});
$.menu.addEventListener('click', function(){
if($.container.left >= 10){
//$.container.left = 0;
$.container.animate(animateStart);
}
else{
//$.container.left = 150;
$.container.animate(animateRight);
}
});
menu is a button, when I touch it, the menu should move to right, and if a touch it again the menu should move to left, so if a use "$.container.left = 150;",the action in the menu work well, but if use animate the menu never return to original position.
I think that the problem is for the animate, but I'm not sure, somebody can I help me ?
Thanks.