Jump to content
Search Community

Makssshow

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Makssshow

  1. Hey there!

    I have an issue on all browsers, but safari is the worst. When I use

     

    gsap.from(".element", {

    x: -20, // or y or yPercent, whatever

    scrollTrigger: {

    trigger: ".trigger",

    start: "top bottom",

    end: "top 50%",

    scrub: 0.1

    },

    });

     

    Elements look like this. It will disappear after repeat animation and depends on scroll speed. How can I fix it?

     

    Examples: https://discoverdesignstudio.com/ (mobile version in the bottom)

    https://juliaciancifoundation.org/education/ (images moving from top to bottom, text)

     

    Screenshot 2021-12-08 at 17.25.30 1 Medium.jpeg

    Screenshot 2021-12-08 at 17.27.33 Small.jpeg

    Screenshot 2021-12-08 at 17.31.34 Small.jpeg

  2. Hi everyone)

    I so much love gsap and scrolltrigger, but I always have some issues.

     

    If I create gsap.to() (doesn't matter what exactly) with jq in the start/end position, on window.resize (so on ScrollTrigger.refresh()) jq doesn't recalculating.

    Also if I will use var and give another value on window.resize it doesn't work too.

    
    gsap.to(".menu", {
        top: -2,
        scrollTrigger: {
          trigger: "html",
          start: "top top",
          end: "+=" + $(".header_wrap").height(),
          markers: false,
          scrub: true,
        },
        ease: Linear.easeNone,
      });

    How can I make it responsive on window resizing? I have to create the page which will work perfect anyway. 

     

    P.S.

    I can't use some element like trigger, this is the most simple example for explaining. Other code and examples are more complicated and I have to use JQ there.

  3. gsap.registerPlugin(ScrollTrigger);

    const rectPoint1 = document.querySelector('.point1').getBoundingClientRect();

    const rectPoint2 = document.querySelector('.point2').getBoundingClientRect();

     

     

     

    gsap.to('.div1', {

      

      y: rectPoint1.y,

      x: rectPoint1.x,

     

      scrollTrigger: {

        trigger: ".point1",

        start: "top 30%",

        end: "bottom 30%",

        toggleActions: "play none reverse none",

        markers: true,

      }

      

    })

     

     

     

    gsap.fromTo('.div1', {

      

      y: rectPoint1.y,

      x: rectPoint1.x,

      

    }, {  

      

      y: rectPoint2.y,

      x: rectPoint2.x,

      immediateRender: false,

      

      scrollTrigger: {

        trigger: ".point2",

×
×
  • Create New...