Toggle between two animaitons smoothly ?

Have a door with simple animation rotation 0 → 90 by one axis (opening).
In animator i have 2 connected states open<->close. (close is same as open but with speed = -1)
I am trying to switch between them. So if door’s open animation is half way through and I toggle close animation the door jumps to fully opened state (90degree on Z) and only then starts closing. I want it to start closing from current location without any ‘jumps’.
Is it possible with animator ? Or shall it be done via scripting ?

It is possible with Animation.
I have created two animations as New Animation and New Animation 1

New Animation : 5 second animation, Opens the door (0 ==> 90)

New Animation 1 : 5 second animation, Opens the door (90 ==> 0)

Then I used the following code to open and close the door

public class NewBehaviourScript1 : MonoBehaviour {

	public Animator TestAni;

	private string[] nm;
int i;

void Start () {
	nm=new string[]{"New Animation","New Animation 1"};
	i = 1;
}
	

	void Update () {
	
		if(Input.GetKeyDown(KeyCode.A)){
			
			Debug.Log ("Clicked!!");

			if (TestAni.GetCurrentAnimatorStateInfo (0).normalizedTime > 1) {

				TestAni.Play (nm*,-1,0);*
  •  	} else {*
    

_ TestAni.Play (nm*,-1,1-TestAni.GetCurrentAnimatorStateInfo (0).normalizedTime);_
_
}*_

* i = i == 0 ? 1 : 0;*

* }*

* }*
}
[98481-states.png|98481]_
_