Jump to content
Search Community

btua

Members
  • Posts

    2
  • Joined

  • Last visited

btua's Achievements

  1. Hi, everyone. I already have website with GSAP animations and I'm trying to connect smooth-scroll library. When I do it, smooth scroll working, but then doen't work ScrollTrigger and website height incorrect This is my code var Scrollbar = window.Scrollbar; // Init Smooth Scrollbar // ====================== Scrollbar.init(document.querySelector("#scroll-container"), { damping: 0.05, renderByPixel: true, continuousScrolling: true, alwaysShowTracks: true }); // 3rd party library setup // More info: https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.scrollerProxy() // ======================== let scrollPositionX = 0, scrollPositionY = 0, bodyScrollBar = Scrollbar.init(document.getElementById("scroll-container")); bodyScrollBar.addListener(({ offset }) => { scrollPositionX = offset.x; scrollPositionY = offset.y; }); bodyScrollBar.setPosition(0, 0); bodyScrollBar.track.xAxis.element.remove(); // tell ScrollTrigger to use these proxy getter/setter methods for the "body" element: ScrollTrigger.scrollerProxy("scroll-container", { scrollTop(value) { if (arguments.length) { bodyScrollBar.scrollTop = value; } return bodyScrollBar.scrollTop; } }); // when smooth scroller updates, tell ScrollTrigger to update() too. bodyScrollBar.addListener(ScrollTrigger.update); And then I have height of page
  2. Hi, everyone How to create animation like on video. When I scrolling image moving and changing, I don't how this animation is called Please help me, how I can do it? anim.mp4
×
×
  • Create New...