Streaming live at 10am (PST)

Show div and close other one

Hi everyone,

I’m stuck on something that is probably easy to do. I’d like to show a certain div (.modal-content) when a target (.modal-trigger) is clicked, hide the div related to the target when the user clicks another target, and show the div corresponding to the target.
This for the sticky section with this illustration.

There’s a tut on the forum but it was recorded during IX1, I couldn’t recreate it for IX2.

Here is my site Read-Only:
(how to share your site Read-Only link)

The usual strategy is that the IX attached to the click does this:

  1. closes all the divs by targetting their common class (even if they’re already closed), so that you’re sure that the one opened is closing
  2. open the clicked one.
1 Like

Thanks vincent,
I had to fiddle with it a little bit. Had to create 3 interactions, 2 class-wide and another one specific for each trigger.


Have a good one! Bonne fin de journée

Hello guys,

I’m kind of having the same issue with an interactive map that I’m building I’ve set up 2 interactions but the second interaction also seems to close the modal again.

I’m not sure as to why.

Heres the link to the site (map section)

Any help would be much appreciated.