It is working fine from the initial position to the set position aligned to a wall, but on the second click because the rotation starts as the same time than the X movement, the window “collides” with the wall.
Question: how to delay the rotation or trigger the rotation at the given X value? Rotating and sliding window
I have only controlled the time, but it’s morel likely that you would set the ‘easein’ and ‘out’ settings (ANIMATECUSTOM(“attr” ,time, easein, out, state1,…stateN) also with a variable.
I agree with @MikeWayzovski, you should use animatecustom(…) to independently controle both operations in time: move vs rotate.
btw, you should skip the d in both functions (animate d slow). The DC performs but depending on one (or the other) or two d’s you get slightly different results and it is without d anyway.