Jump to content
Search Community

fania

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by fania

  1. So I got it working now. I was using GSAP 3.4.2, realized that the examples I was looking at used the latest and greatest 3.6.0. As soon as I updated the package, issue went away.
  2. Hello, new member here. Been using your library for a long time =) First time trying out a horizontal site, finally got a request to do one. So using ScrollTrigger for this functionality. Basically trying to replicate the examples in this post -> https://greensock.com/forums/topic/24309-scrolltrigger-horizontal-scrolling/. However, its not quite working right. I have 4 divs inside the container. These divs are set to 100% width ( may need to use pixels, let me know ) When I run, it works... I see the first "section" div, it scrolls but the other divs are hidden. When I inspect, the container has overflow set to hidden, which explains why the rest of the divs are not visible. When I disable overflow, all the sections show up and works fine. I curious on what I'm doing wrong here, when I inspect the code in this post, the container does not have overflow set at all, but on mine it does. Any help would be appreciated. Code Pen Example Looked at the line where it actually sets overflow: hidden --- ScrollTrigger.js Line 896 pin.firstChild && !_maxScroll(pin, direction) && (pin.style.overflow = "hidden"); // protects from collapsing margins! Thank you!
  3. Hey thanks for the response, yes of course, will do soon. Thank you!
  4. Hello, new member here. Been using your library for a long time =) First time trying out a horizontal site, finally got a request to do one. So using ScrollTrigger for this functionality. Basically trying to replicate the examples in this post. However, its not quite working right. I have 4 divs inside the container. These divs are set to 100% width ( may need to use pixels, let me know ) When I run, it works... I see the first "section" div, it scrolls but the other divs are hidden. When I inspect, the container has overflow set to hidden, which explains why the rest of the divs are not visible. When I disable overflow, all the sections show up and works fine. I curious on what I'm doing wrong here, when I inspect the code in this post, the container does not have overflow set at all, but on mine it does. Below is a condensed version on my end, the parent-container div is just the outer element. I added it so its close to how I have it setup. <style> .parent-container { width: 100%; } .container { display:flex; flex-wrap:wrap; flex-direction:column; height:100vh; } .section { position: relative; display: flex; width: 100%; // Use Pixels instead? height: 100%; padding: 0 40px 0 80px; margin: 40px 0; } </style> <div class="parent-container"> <div class="container"> <div class="section"></div> <div class="section"></div> <div class="section"></div> <div class="section"></div> </div> </div> this.scrollContent = document.getElementsByClassName("container")[0]; this.gsap.to(this.scrollContent, { x: () => -(this.scrollContent.scrollWidth - document.documentElement.clientWidth) + "px", ease: "none", scrollTrigger: { trigger: this.scrollContent, invalidateOnRefresh: true, pin: true, scrub: 1, end: () => "+=" + this.scrollContent.offsetWidth } }) Any help would be appreciated. Looked at the line where it actually sets overflow: hidden --- ScrollTrigger.js Line 896 pin.firstChild && !_maxScroll(pin, direction) && (pin.style.overflow = "hidden"); // protects from collapsing margins! Thanks you!
×
×
  • Create New...