diff --git a/www/content/examples/modal-bootstrap.md b/www/content/examples/modal-bootstrap.md index 50e1614e..b4138638 100644 --- a/www/content/examples/modal-bootstrap.md +++ b/www/content/examples/modal-bootstrap.md @@ -4,8 +4,7 @@ template = "demo.html" +++ Many CSS toolkits include styles (and Javascript) for creating modal dialog boxes. -This example shows how to use HTMX to display dynamic dialog using Bootstrap, and how to -trigger its animation styles in Javascript. +This example shows how to use HTMX alongside original JavaScript provided by Bootstrap. We start with a button that triggers the dialog, along with a DIV at the bottom of your markup where the dialog will be loaded: @@ -15,77 +14,59 @@ markup where the dialog will be loaded: hx-get="/modal" hx-target="#modals-here" hx-trigger="click" - class="btn btn-primary" - _="on htmx:afterOnLoad wait 10ms then add .show to #modal then add .show to #modal-backdrop">Open Modal + data-bs-toggle="modal" + data-bs-target="#modals-here" + class="btn btn-primary">Open Modal -
+ ``` This button uses a `GET` request to `/modal` when this button is clicked. The contents of this file will be added to the DOM underneath the `#modals-here` DIV. -We're replacing Bootstrap's javascript widgets with a small bit of Hyperscript to provide -smooth animations when the dialog opens and closes. - -Finally, the server responds with a slightly modified version of Bootstrap's standard modal +The server responds with a slightly modified version of Bootstrap's standard modal ```html - -