Hi - just migrated to v3, and not sure what I'm doing wrong, here's the code that works in one version, but not the other. It is the second one, the one that fails, that I want.
//works
wis.slideToTopOfViewport = function(slideNum, wrapper) {
gsap.registerPlugin(ScrollToPlugin);
let targetElem = wrapper.querySelector(`.slideW[data-filename="Slide${slideNum}"]`);
console.log(targetElem); // works
gsap.to(targetElem, {duration:0.4, y:-200 }); //works
}
//fails
wis.slideToTopOfViewport = function(slideNum, wrapper) {
gsap.registerPlugin(ScrollToPlugin);
let targetElem = wrapper.querySelector(`.slideW[data-filename="Slide${slideNum}"]`);
console.log(targetElem); // works
gsap.to(window, {duration:0.4, scrollTo: targetElem}); //FAILS!!
}