let widthContianer = container.clientWidth;
const tl = gsap.timeline({
scrollTrigger: {
trigger: container,
pin: true,
scrub: 0.5,
start: 'top 20%',
end: `${(widthContianer * 3) / 2}`,
invalidateOnRefresh: true,
},
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter