Hey guys,
Started playing a bit with ScrollTrigger and loving it, great job!
Is it possible to pin elements taller than the viewport and make them scrollable though?
Like this: https://abouolia.github.io/sticky-sidebar/ check out the "Scrollable Sticky Element" example, try scrolling up and down to see what I mean.
Fingers crossed
For anyone interested, here's the helper function I came up with:
function stickyBothDirections(element, vars) {
vars = vars || {};
element = gsap.utils.toArray(element)[0];
let keywords = {top: "0", center: "50%", bottom: "100%"},
overlap, topOffset,
updateOverlap = () => {
topOffset = ((typeof(vars.start) === "function" ? vars.start() : vars.start || "0 0") + "").split(" ")[1] || "0";
topOffset = keywords[topOffset] || topOffset;
topOffset = ~to