bigskysoftware/htmx

Custom modal in examples not working

cmnstmntmn opened this issue · 4 comments

Hi, hmx is a briliant project!
Congrats to you all.

I'm trying to implement a custom modal,
however the custom modal in the examples is not working.

<div id="modal" _="on closeModal add .closing then wait for animationend then remove me">
	<div class="modal-underlay" _="on click trigger closeModal"></div>
	<div class="modal-content">
		<h1>Modal Dialog</h1>
		This is the modal content.
		You can put anything here, like text, or a form, or an image.
		<br>
		<br>
		<button class="btn danger" _="on click trigger closeModal">Close</button>
	</div>
</div>

what puzzles me is the _="..." attribute that is not doing anything ..
replaced it with hx-trigger still is not triggering anything.

am i missing something?
thank you

I think you need to add the CSS as well.

nah, is not that

This example needs some client side library to do client scripting and in this case uses hyperscript which uses _="" tags to define human readable scripts. Without including a script link to hyperscript in your page header this part of the example will not work.

thanks @MichaelWest22 , what was it.