Jump to content
Search Community

servus

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by servus

  1. Hi,

    i would like to draw a SVG and on finish to start the image reveal. I don´t know what i am doing wrong, the SVG animation do not start. After a while the image reveals but without SVG animation. Does anybody have an idea please?

    Thanks for helping!

    See the Pen QWmjprq by druplash (@druplash) on CodePen

  2. Hi!

    I use ScrollTo and on Desktop it works perfect, on iPhone it do not scroll exactly to target id, it stops scrolling before. Sometimes half width of screen, sometimes less and sometimes more, it´s very different. I do have two sections with class "scrollTo". Does anybody have an idea and could help me please?

    Thanks!

     

      /* ScrollTo GSAP */
      $(document).ready(function() {
      
        var links = $('.scrollTo a')
        
        links.on( 'click', function(e) {
          e.preventDefault();
        
          var targetSection = $(this).attr('href');
          var targetOffset = $(targetSection).offset().top;
          
          TweenMax.to(window, 1, { scrollTo:{y:targetOffset }, ease: Power3.easeOut } );
      
        });
        
    });

     

  3. Hello,

    i am very new to GSAP and i am getting in some troubles, which i could not solve after hours and hours trying to find a solution.

     

    I think everything is loading correctly but i get this error: gsap is not defined. First i load all GSAP libraries and last my custom.js. Please can somebody take a look?

     

    Thanks a lot for helping.

     

    Drupal.behaviors.revealImages = {
        attach: function(context, settings) {
    
            gsap.registerPlugin(ScrollTrigger);
    
            let revealContainers = document.querySelectorAll(".reveal");
    
            revealContainers.forEach((container) => {
                let image = container.querySelector("img");
                let tl = gsap.timeline({
                    scrollTrigger: {
                        trigger: container,
                        toggleActions: "restart none none reset"
                    }
                });
    
                tl.set(container, {
                    autoAlpha: 1
                });
                tl.from(container, 1.5, {
                    xPercent: -100,
                    ease: Power2.out
                });
                tl.from(image, 1.5, {
                    xPercent: 100,
                    scale: 1.3,
                    delay: -1.5,
                    ease: Power2.out
                });
            });
    
        }
    };

     

    Bildschirmfoto 2021-05-07 um 22.18.54.png

×
×
  • Create New...