Is it possible to desactivate animations for specific breakpoint in the new GSAP timeline panel

Hey there! :waving_hand:

I’ve been testing the new GSAP timeline panel in Webflow – really loving the overall experience so far!

Quick question though: is there currently a way to disable specific animations based on breakpoints (like for hover, scroll, etc.)?
I tried digging around, but I couldn’t find any way to manage that.

It would be super useful, especially when designing mobile-first experiences where some animations just don’t make sense. If it’s not possible yet, no worries – I’ll switch back to classic interactions for now. But just wanted to check in case I missed something.

Thanks a lot! :folded_hands:

4 Likes

Hi there,

To disable GSAP timeline animations at specific breakpoints in Webflow, you can use a combination of GSAP’s matchMedia feature and custom code. Here’s a basic approach:

You can add your GSAP animations in a Custom Code block and wrap them in a matchMedia condition. This allows you to control when animations play based on screen width. The Webflow x GSAP Resource Hub (https://gsap.com/resources/Webflow/) provides additional examples and tutorials for implementing responsive animations.

For more complex animation control, you can explore Webflow Interactions with GSAP (https://help.webflow.com/hc/en-us/articles/42832301823635-Intro-to-interactions-with-GSAP) which offers built-in tools for creating and managing animations directly on the canvas.

Hopefully this helps! If you still need assistance, please reply here so somebody from the community can help.

A little note here that the team are aware of this need and it’ll be implemented before this version of interactions becomes the default :green_heart:

Note for mods/admin - I tried to link to the gsap matchmedia docs and a Tim Ricks youtube tutorial but the forum won’t let me :woman_shrugging:

Mod Edit: https://gsap.com/docs/v3/GSAP/gsap.matchMedia()/
@CassieEvans - as soon as you have some more engagement on the forum that restriction will be lifted. -@jeffselser

4 Likes

Hey Cassie!

So there is no way to use GSAP with the Webflow UI & remove certain animations on lower breakpoints? If so, any idea how to extract the animation code and use them with JS breakpoints? Thanks!

1 Like

Anyone else stuck on this still? Looking for a quick solution to “kill” GSAP interaction on lower breakpoints. What’s the JS needed to kill the switch on mobile? Bummed out this was not simply added similar to how classic interactions were built.

Best solution I could find for now is overwriting the CSS that’s getting animated on lower breakpoints.

For example when you’re transforming the element with gsap, you set a custom css property in Webflow

transform: none !important

You could also specify this to the y or x axis

2 Likes

Thanks! Pretty good solution.

I found a hacky solution. :smiling_face_with_sunglasses:

Thanks @CassieEvans, for sharing gsap match media function docs.

Quick Demo :backhand_index_pointing_down:

preview


Focus on the IRON MAN text appear effect. On desktop device it’s come from bottom. But on mobile device it’s come from top


Webflow cloneable link :backhand_index_pointing_down:
:link: Breakpoint Based GSAP Powered Webflow Interactions - Webflow


YouTube tutorial link :backhand_index_pointing_down:
Breakpoint Based GSAP Powered Webflow Interactions

Please consider using English Subtitle/CC when watch on youtube


So the solution is, add GSAP powered Webflow interaction based on Combo Class [e.g. .element.cc-desktop, .element.cc-mobile]. Then add or remove that combo class top of the main class, according to breakpoints using gsap.matchMedia() function and little bit of Jquery code.

<script defer>
let mm = gsap.matchMedia();
mm.add(
  {
    isDesktop: "(min-width: 480px)",
    isMobile: "(max-width: 479px)",
  },
  (context) => {
    let { isDesktop, isMobile } = context.conditions;
    $(".text").toggleClass("cc-desktop", isDesktop);
    $(".text").toggleClass("cc-mobile", isMobile);
  }
);
</script>

If the above codes :backhand_index_pointing_up: not work for you, then try to create Custom event trigger interaction for different breakpoints, then trigger that Custom event via ix3 emit function with your Custom event name. Here is the codes example, for how you can trigger your Custom event based on different breakpoints.
Remember, you need to include the codes above :backhand_index_pointing_up: for toggle your element classes based on different breakpoints.

<script defer>
Webflow ||= [];
Webflow.push(() => {});
const ix3Module = Webflow.require("ix3");
ix3Module.ready().then(() => {
  mm.add(
    {
      isMobile: "(max-width: 479px)",
    },
    (context) => {
      let { isMobile } = context.conditions;
      if (isMobile) {
        ix3Module.emit("Page load interaction for mobile"); // Your Custom event name
      }
    }
  );
});
</script>
1 Like

@kreativepro I think this solution can help you :backhand_index_pointing_right: Is it possible to desactivate animations for specific breakpoint in the new GSAP timeline panel - #9 by Developer-Zahid

Thanks @CassieEvans, for sharing gsap.matchMedia() function docs.

Here is my solution using gsap.matchMedia() :backhand_index_pointing_down:

1 Like

Hi there - I haven’t tested this but It’s raising a bit of a red flag for me. This is likely only going to work on initial load and not if the screen resizes.

This is definitely a creative solution, but I would class this more as a ‘hack’ and wouldn’t recommend using this on a production site.

If you need breakpoints, either use IX2 for now or wait for IX3 to support breakpoints (it is coming soon)

Just a little additional note that it’s not recommended to overwrite GSAP with CSS transforms, this can break your animation and lead to unreliable/unexpected behaviour.

Thanks @CassieEvans, for spotting the bug that appeared after screen resize. From my side, it only happened in the Brave browser. I found the root cause — it was due to Webflow’s async handler. The issue has been fixed now. Could you please check again? Also, I’ve updated my post and mentioned an alternative solution using a Custom event trigger.

Hey Zahid, appreciate your commitment to find a way around this, but I really wouldn’t recommend hacking any routes around this. Breakpoints are coming very soon.

If you need responsive animations, use IX2 for now.

1 Like

@CassieEvans Thank you for your replies in the thread. Are you able to share how soon breakpoints will become available? Even if you could share whether it’s days or weeks, would be super helpful.

I’m new to GSAP and have created a really great animation for a client project but it needs to be disabled on smaller breakpoints. Unfortunately I’m not savvy enough to code it from scratch without Webflow’s timeline so really relying on breakpoints becoming available :cry:

1 Like

Hello @Audrey_AceStudio

If you need to disable your animation on mobile breakpoints, before animation breakpoints becomes available, you can create two versions of your animated component one for desktop with the animation, hide it on mobile, and then create a mobile version without the animation and hide that on desktop. I hope this helps.

Thank you @Pablo_Cortes

I’ve done this for now, but it’s certainly not the cleanest of solutions. Hopefully breakpoints become available soon :crossed_fingers:

1 Like

Just jumping in again to reiterate - The GSAP powered version of interactions isn’t the default yet as it’s in active development and working towards feature parity. If you need responsive animations - use the default version of Webflow interactions for now.

The routes provided above are hacks. Creating two versions of your animated component will work aesthetically, but under the hood GSAP is animating twice as many elements (even when you can’t see them) so your site performance may suffer slightly as a result.

Approach this with care folks. We will close this gap for you as soon as possible. Thanks for your early feedback.

4 Likes

@CassieEvans Thank you!! :folded_hands:

@CassieEvans Is there an update when breakpoints for GSAP will be available? Thanks a lot! :slight_smile: