Animate vertical shift

I used to know how to do this but I’ve forgotten can someone give me a hint?