Hi @mvaneijgen, thank you for your reply. However, my goal is on the onEnd() function here
function onEnd() {
if(direction === 1) {
// scale the element all the way to 0
tl.to(el, {scale: 0, width: 0, height: 0, duration: 1});
} else if(direction === -1) {
// scale the element all the way to 1
tl.to(el, {scale: 1, width: '300px', height: '300px', duration: 1});
}
}
for example, when I scroll down and release, the element will check the scroll position then scale the element based on scroll direction (to full size or zero)
Here's what I tried to do so far
https://codepen.io/sovai/pen/oNQPKJX