This is my first project using greensock and my javascript skills are rather weak.
I've implemented horizontal scroll found here and this is working great. However I dont' want horizontal scroll below 1100 pixels. What is the best way to do that?
current code:
gsap.registerPlugin(ScrollTrigger)
let container = document.getElementById("chapter-wrapper");
gsap.to(container, {
x: () => -(container.scrollWidth - document.documentElement.clientWidth) + "px",
ease: "none",
scrollTrigger: {
trigger: container,
invalidateOnRefresh: true,
pin: true,
scrub: 1,
end: () => "+=" + container.offsetWidth
}
})