GSAP IMAGE PARALLAX EFFECT WITH GSAP

Elementor 3.17 Update Broke My Forms — Here’s the Fix

Everything looks fine for about twelve seconds. Then the contact forms stop submitting. No error message. No console warning. Just… ...

Read More

My WordPress Site Got Hacked (Not My Fault — wp2shell Did It)

Someone just exploited a hole in WordPress core that lets them take over your server without logging in. Here's what ...

Read More

Elementor Update Just Broke My Site — Here’s How I Sorted It

Updated Elementor and your site broke? I walk through the actual fixes that worked when it happened to a client ...

Read More

How To Make A Vertical 3D Gallery Slider

So if you follow along in the video, I refer to this blog post for you to enter code at ...

Read More
Showing Slide 1 of 5

So if you follow along in the video, I refer to this blog post for you to enter code at certain point into the HTML widget, so below is everything you will need!

The Following code goes into the HTML widget:

				
					<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/ScrollTrigger.min.js"></script>

<script>
  gsap.utils.toArray(".parallax-section .parallax-image img").forEach((section, i) => {
    // Get the height of the section container
    const container = section.closest('.parallax-section');
    const heightDiff = section.offsetHeight - container.offsetHeight;

    if (heightDiff > 0) {
      gsap.fromTo(section, { 
        y: -heightDiff
      }, {
        scrollTrigger: {
          trigger: container, // Use the section top as the trigger
          scrub: true,
          markers: false, 
          start: "top bottop%",
          end: "bottom 25%"
        },
        y: 0,
        ease: "none"
      });
    }
  });
</script>