Jump to content
Search Community

bujutsu1

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by bujutsu1

  1. Hey community!

    I made a really simple parallax effect with Scrolltrigger using scrub.

     

    On desktop it works fine but on mobile - Safari - the image jumps when the Adress bar hides/comes back into view.

    I also can see the markers jump.

     

    here is my code:

     

    gsap.fromTo(
    imageRef.current,
    {
    yPercent: -20,
    autoAlpha: 1,
    },
    {
    yPercent: 20,
    ease: "none",
    autoAlpha: 1,
     
    scrollTrigger: {
    trigger: imageRef.current,
    scrub: true,
    markers: true,
    },
    }
    );

     

     

    any hints on how to fix this?

     

     

    thank you already!

     

    have a great weekend!

     

     

  2. Hi all!

    i am quite new to react and gatsby and i started my first project using gsap.

    I get this weird error wich i really don't know how to fix (see below)...

     

    .. and it doesn't happen when i just switch to the page after starting the server.

    It happens when i reload the page!

     

    anyone?

     

    Thanks already!!

     

     

    The page didn't server render (SSR) correctly

    React components in Gatsby must render successfully in the browser and in a node.js environment. When we tried to render your page component in node.js, it errored.

    • URL path: /
    • File path: node_modules/gsap/gsap-core.js

    error

    Cannot read property 'querySelectorAll' of undefined

      626 |     //takes any value and returns an array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.
      627 | toArray = function toArray(value, leaveStrings) {
    > 628 |   return _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call(_doc.querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];
          | ^
      629 | },
      630 |     shuffle = function shuffle(a) {
      631 |   return a.sort(function () {
×
×
  • Create New...