Jump to content
Search Community

jollygreen

Members
  • Posts

    26
  • Joined

  • Last visited

Posts posted by jollygreen

  1. This is an old post but thought the following solution could be of interest;  we can use the ResizeObserver. 

    // Function to update scrollTrigger positions dynamically
        const updateScrollTrigger = () => {
            elementsRef.current.forEach(element => {
                ScrollTrigger.refresh();
            });
        };
    
        // Watch for changes in the size of the dynamic height element (#resizeableElement)
        const resizeObserver = new ResizeObserver(updateScrollTrigger);
        resizeObserver.observe(document.getElementById('resizeableElement')); // Use the correct ID
    
        // Cleanup function
        return () => {
            resizeObserver.disconnect();
        };

     

  2. I tried to create a peeling effect - please see demo.  Could you please advise on how to make the green circle (front) to animate along with the gradient circle (back)?  They are not in synch.

     

    Would there be a better way to recreate the peeling effect?

    See the Pen oNPgwKG by jollygreen10 (@jollygreen10) on CodePen

  3. 16 minutes ago, akapowl said:

    I don't know why you put that tween on the h4 in your mouseleave there, but when I remove that, it's working just like in the demo you provided initially. Is it not for you?

    Yes, it works for me too when remove it.  Thanks.

     

    17 minutes ago, akapowl said:

    I went ahead and made your targets a bit more specific (so you don't end up animating all h4s on your page for example) and removed those durations of .75, because you don't need them anymore since you have those in the defaults.

    got it

     

    Thank you very much!

  4. I can animate text with the following:

    var headline = document.querySelector('#headline');
    var splitHeadline = new SplitText(headline, {type:'words,chars'});
    var chars1 = splitHeadline.chars; 
    
    gsap.from(chars1, {duration: 0.5, autoAlpha:0, ease:  SteppedEase.config(6), stagger: 1 / 10 })

    However, if I change "autoAlpha:0" with "visibility:'hidden'" to remove the opacity, the text doesn't animate.  I'd appreciate your expertise.

     

     

  5. I'm trying to create an infinite carousel with a stop button.  I got the following error on the console: "Uncaught Cannot add undefined into the timeline; it is not a tween, timeline, function, or string." Because of that my stop button doesn't work.  Would you know why I got this error?  Your help would be appreciated.  

     

    See the Pen WmwYOW by jollygreen10 (@jollygreen10) on CodePen

     

    See the Pen WmwYOW by jollygreen10 (@jollygreen10) on CodePen

×
×
  • Create New...