Setup.home = () => { let tl = gsap.timeline({ repeat : -1, yoyo : true, defaults : { ease : "sine.inOut" } }); tl.fromTo(".link.book", { y : - 5 },{ duration : 1, y : 5 }); $(".wrap.book").hover( function() { gsap.to(this,{ duration : 0.1, y : -20 }); }, function() { gsap.to(this,{ duration : 0.1, y : 0 }); }); } if (SiteIsLibrary) { if (BodyIsHome) { $(Setup.home()); } }