A modern answer for 2021. You don't have to use jQuery for this. But I'm assuming you want to. You can use a trendy npm library like popmotion (600k downloads per week) in conjunction with jQuery like so:
// poo.el.animate({top: footerTop - horsePooHeight})
// your imports may vary - I'm using Angular, popmotion focuses more on Vue and React
import { cubicBezier } from 'popmotion'
declare const popmotion: any
const {tween, easing} = popmotion
const fling = cubicBezier(0, .42, 0, 1)
tween({from: 100, to: 200, duration: 400, ease: fling}).start((v) => $(el).css('top', v))
tween({from: 100, to: 300, duration: 400, ease: easing.linear}).start((v) => $(el).css('left', v))
Where el is a jQuery element.
Good news. Its got a whole world more power in terms of easing, allowing curves. Bad news is its a little more complicated but if you can understand the above code you will be fine.
PS I'm not saying popmotion should be used with jQuery. I'm just saying it can be.
PPS Never forget that J-E-S-U-S loves you :D
PPPS jQuery is fine for simpler animations, but the lack of interest in questions like this and the lack of updated on jQuery animation libs prove that jQuery on its own is dead for more complex animations.