Answer the question
In order to leave comments, you need to log in
How to call modal in Semantic UI?
Hello!
Guys, tell me, who knows how to call modal windows in the semantic ui framework?
There are specific instructions: semantic-ui.com/modules/modal.html#modal
call script, stml codes of the windows themselves - everything is exposed. But here's how to register a link, when you click on which this window will be called?
and how to be provided that it is necessary to set some pop-up windows to different links?
thank!
Answer the question
In order to leave comments, you need to log in
If we talk about several different windows, then you can do it as follows. In the loop, form all windows with different id
, and in javascript already call them.
HTML:
<?php foreach ($items as $item): ?>
<button class="ui icon button show-modal" data-modal="#item-modal-<?= $item['id'] ?>">
<i class="pencil icon"></i>
</button>
<div class="ui modal" id="item-modal-<?= $item['id'] ?>">
...
</div>
<?php endforeach; ?>
$('.show-modal').click(function (e) {
e.preventDefault();
var modal_id = $(this).attr('data-modal');
$(modal_id).modal('show');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question