I use yii2 and bootstrap4 for it ( https://github.com/yiisoft/yii2-bootstrap4 )
I registered in a layout
<?php Modal::begin(['id'=>'simple-modal', 'size'=>'modal-lg']); Modal::end(); ?>
If somewhere in the code to write a link with data-*
attributes such as -toggle
and -toggle
, then this modal window will be called
<a class="btn btn-success" href="/user/create" data-toggle="modal" data-target="#simple-modal">Создать</a>
Question: Is it possible to specify the href
attribute in a simple, exactly in the same style, so that when you click, the query will automatically go away in a given way? Or it is not possible and you should always do this:
$('#wrapper').on('click', '.modal-action', function () { $('#simlple-modal') .find('#modal-content') .load($(this).attr('href')); });
)$('#wrapper').on('click', '.modal-action', function () { $('#simlple-modal') .find('#modal-content') .load($(this).attr('href')); });
)$('#wrapper').on('click', '.modal-action', function () { $('#simlple-modal') .find('#modal-content') .load($(this).attr('href')); });
??