модальное_окно

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
модальное_окно [2022/01/19 09:57] adminмодальное_окно [2022/02/11 17:55] (текущий) – внешнее изменение 127.0.0.1
Строка 8: Строка 8:
   <div class="modal-dialog">   <div class="modal-dialog">
     <div class="modal-content">     <div class="modal-content">
-      <img src="preload.gif">+        <div style="margin:auto"> 
 +            <img class="img" src="<?= Url::to(['/img/preload.gif'])?>"
 +        </div>
     </div>     </div>
   </div>   </div>
Строка 15: Строка 17:
  
 <code | Yii2 js> <code | Yii2 js>
 +<?php
 $this->registerJs(" $this->registerJs("
-    $(document).on('click', '.js_openWindowModal', function () { +    $(document).on('click', '.js_openWindowModal', function (event) { 
-            $('#windowModal').modal('show').find('.modal-content').load($(this).href);+        event.preventDefault(); 
 +        $('#windowModal').modal('show').find('.modal-content').load($(this).attr('href'));
     });     });
 "); ");
Строка 92: Строка 96:
 <?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
 </code> </code>
-<code | Yii2 JS>+<code | Yii2 JS для формы>
 <?php <?php
-$this->renderJS("+$this->registerJS("
     $(document).on('beforeSubmit', '.js_modalForm', function (event) {     $(document).on('beforeSubmit', '.js_modalForm', function (event) {
          
  • модальное_окно.1642586239.txt.gz
  • Последнее изменение: 2022/01/19 11:57
  • (внешнее изменение)