Hi,
I am trying to replace Scrollmagic with ScrollTrigger, but the animation is not triggered.
The Scrollmagic Code is:
let cTimeLineMax = gsap.timeline().set(divHeroBg, {y: 0, opacity: 1}).to(divHeroBg, 1, {
y: -50,
opacity: .8,
ease: Quad.easeInOut
});
new ScrollMagic.Scene({
triggerElement: divHeroContentWrap2, duration: divHeroContentWrap1.height(), triggerHook: 1
}).setTween(cTimeLineMax).addTo(ScrollMagicController);
I tried to replace it with the following ScrollTrigger code:
gsap.timeline({
ScrollTrigger: {
trigger: divHeroContentWrap2,
start: "center center",
end: this.iScreenHeight + "px",
pinSpacing: false
}
}).set(divHeroBg, {y: 0, opacity: 1}).to(divHeroBg, 1, {
y: -50,
opacity: .8,
ease: Quad.easeInOut
});
Does anybody see the mistake?