To set up multiple modal windows in Webflow—such as for contact info and enlarged painting views—you need to build reusable interactions and link each modal to the correct trigger. Here’s how to do it effectively.
1. Structure Each Modal in the Designer
- For each modal, create a new Div Block and name it something like “Modal - Contact” or “Modal - Painting 1”.
- Set the position of the modal wrapper to Fixed, with full width and height, and give it a high z-index (e.g., 9999).
- Set Display: None (you’ll toggle this with interactions).
- Inside each modal, create a background overlay (e.g., semi-transparent black) and a modal content box that contains your content (like an image or contact details).
2. Create a Modal Open Trigger
- Add a Button or Link Block near each painting or “Contact” CTA.
- Give this trigger a unique identifier using a custom attribute like
data-modal="contact" or data-modal="painting1". - Label your modals with matching selectors or other corresponding data attributes (e.g.,
data-id="contact") for consistency.
3. Build the Open Interaction
- Create a Webflow Interaction (on click) that targets the correct modal.
- Set the initial state of the modal to Opacity: 0, Display: None.
- On click:
- Set Display: Block.
- Animate to Opacity: 100% (fade in).
- Create one interaction per unique modal, or use one reusable interaction if you’re using consistent class names and logic.
4. Add a Close Button Inside Each Modal
- Inside each modal, add a Close Button (e.g., “X” icon).
- Create a click interaction on this button:
- Animate Opacity to 0%.
- Then set Display: None.
5. Optionally Allow Clicking Outside to Close
- Add a click interaction on the background overlay div to trigger the same “close modal” animation.
- Ensure clicks on the modal content area do not close the modal (stop propagation using Webflow Interactions by excluding inner elements).
Summary
To manage multiple modals in Webflow: build separate modal wrappers, trigger them using unique attributes or connections, and create individual open/close interactions for each. This helps showcase contact info or artwork enlargements cleanly and efficiently on your art website.