Hi guys, no worries I manage to fix it, was quite easy but I forgot to add "path" after the target element name! Here's the updated code for anyone else in the future...
$(".footer-spacer").each(function (index) {
let triggerElement = $(this);
let targetElement = $(".footer-logo path");