Streaming live at 10am (PST)

[answered] How to target an element that has multiple classes in an Interaction?


#1

I'm finding myself in a situation where I can't target a class through interactions because the target class is not recognised by the interactions panel. My object and class are there, the class appears in the style manager, but the interactions window doesn't recognise it... I had the same thing yesterday and suddenly the class was recognised out of the blue. what could be causing this?


#2

It's not a bug, it's a Webflow limitation.

If you give a class ".mydiv" to an element, you'll be able to target it.

If you pile 2 classes on an element, like ".mydiv .lastdiv", it won't show up anymore in the "target other element" box. Neither .mydiv nor .lastdiv.

But there is a workaround, and you can till target the element getting the ".last" class.

  1. create a dummy (temporary, draft) div
  2. give it only the class you want to target (".last")
  3. go back to interaction, target the class
  4. delete the dummy element
  5. profit

I used to say "use with care" but I'm using this for so long and so often that I'd say it's a pretty safe workaround. I have no idea why the limitation is in place to begin with.


#3

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.