-
Describe your problem 🧐Swup JS is a very nice library, thank you for that. But I need something small as infrastructure, which I could not achieve. Think of it this way;
I wanted to use the https://swup.js.org/getting-started/demos/#fragment-support-modal feature for this. But in this case, the "from" and "to" containers conflict depending on the scenario. For this, it is necessary to create containers differently. For example: containers: [
{from: "#from_container", to: "#to_container"}
] Can I make my point? I will add the id If they were both the same, the following scenario would occur; <main id="container">
...
...
</main>
<div id="container"></div> For the above to work properly, It will just grab the What is your question? 🙋♀️It will just grab the URL to minimal reproduction 🔗https://swup-demo-modal-overlay-temp.replit.app/ Checked all these? 📚
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What part of the linked fragment example doesn‘t work for your project? In theory, that should fit your use case perfectly. With fragments, you can define different containers for each direction, as in from/to. |
Beta Was this translation helpful? Give feedback.
-
There's also a plugin readme section about the recommended markup for modal use cases. <div id="swup" class="transition-main">
<!-- The modal overlaid on the main content -->
<main id="car" class="modal">
<h1>Car Y</h1>
<p>Lorem ipsum dolor...</p>
</main>
<!-- The list of cars overlaid by the modal above -->
<section>
<ul>
<li><a href="/cars/x/">Car X</a></li>
<li><a href="/cars/y/">Car Y</a></li>
<li><a href="/cars/z/">Car Z</a></li>
</ul>
</section>
</div> |
Beta Was this translation helpful? Give feedback.
There's also a plugin readme section about the recommended markup for modal use cases.