Jump to content
Search Community

CreateSean

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by CreateSean

  1. @Cassie That makes sense - but I'm not sure how to insert the 0 and 1 into the array.

     

    I tried this let snapValues = [0,1]; but that didn't do anything. I figure that's cause snapValues is being set further down, but I looked at that and don't know what to modify in order to add the 0 and 1.

     

    Really appreciate all your help. Javascript is really my weakest skill and I'm lost here.

     

    edit

     

    experimented some more and setting let widths = [0, 1] seems to work

  2. I'm a newbie to gsap - also rather weak at javascript.

     

    I'm working on a new site with a section that horizontal scrolls - that is working however scroll snap does not align sections with the edge of the viewport as expected.

     

    In the above codepen - I've also got a modal (powered by AlpineJs) that slides in from the left, but because the scroll snap isn't aligning with the edge of the browser it looks wrong. is it possible to have this align to the left edge of the browser if scroll snap doesn't work?

     

    Not sure why the embedded codepen is not horizontal scrolling, but if you go to the codepen site it does horizontal scroll.

     

     

    See the Pen bGoLBVL?editors=1010 by createsean (@createsean) on CodePen

  3. 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
          }
        })

     

×
×
  • Create New...