Use Webflow dropdown Trigger to play custom animations

Hello,

Does someone already played with Webflow Trigger Animations to play custom animations ?

Let me explain what I mean : I would like to add some custom css and/or add a class when the dropdown is opens and remove them when the dropdown closes.

I would like to use Webflow trigger for this I think this is the most accurate way to do it.

I looked at Webflow JS, I see that kind of code :

Webflow.require("ix2").init({
  events: {
    e: {
      id: "e",
      name: "",
      animationType: "preset",
      eventTypeId: "DROPDOWN_OPEN",
      action: {
        id: "",
        actionTypeId: "GENERAL_START_ACTION",
        config: {
          delay: 0,
          easing: "",
          duration: 0,
          actionListId: "a",
          affectedElements: {},
          playInReverse: false,
          autoStopEventId: "e-2",
        },
      },
      mediaQueries: ["main", "medium", "small", "tiny"],
      target: {
        id: "655de5e209f20d6249b3d030|c436cccf-5ee6-db28-8041-ba0ea01d4248",
        appliesTo: "ELEMENT",
        styleBlockIds: [],
      },
      targets: [
        {
          id: "655de5e209f20d6249b3d030|c436cccf-5ee6-db28-8041-ba0ea01d4248",
          appliesTo: "ELEMENT",
          styleBlockIds: [],
        },
      ],
      config: {
        loop: false,
        playInReverse: false,
        scrollOffsetValue: null,
        scrollOffsetUnit: null,
        delay: null,
        direction: null,
        effectIn: null,
      },
      createdOn: 1662083558057,
    },

But I cannot “catch” the same trigger to do what I want. I also tried with the Webflow object but cannot catch the value

If someone has an idea on how to do it, that could be great :slight_smile:
Thanks