E
E
exactly the most2017-01-23 10:12:49
JavaScript
exactly the most, 2017-01-23 10:12:49

How to make a button in bootstrap to remove the window after a while?

function phone() {
//	
    var formphone = `
<div id="myModalBoxPhone"  class="modal fade" tabindex="-1">
  <div class="modal-dialog">
    <div class="modal-content">
      <!-- Заголовок модального окна -->
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">Оставьте ваши данные и вам перезвонят.</h4>
      </div>
      <!-- Основное содержимое модального окна -->
      <div class="modal-body">
        
        <form class="form-horizontal" role="form">
  <div class="form-group">
    <label for="inputName" class="col-xs-3 control-label">Как вас зовут?</label>
    <div class="col-xs-8">
      <input type="text" name="name" class="form-control" id="inputName" placeholder="Ваше имя?"  required>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPhone" class="col-xs-3 control-label">Ваш телефон</label>
    <div class="col-xs-8">
      <input type="phone" name="phone" class="form-control" id="inputPhone" placeholder="Введите  ваш номер телефона" required>
    </div>
  </div>
<!-- Футер модального окна -->
      <div class="modal-footer">
        <button  type="submit"  data-target="#myModalSenksPhone" data-toggle="modal" class="btn myModalSenksPhone btn-primary open-form" >Оставить заявку</button>
      </div>
</form>
      </div>
      
  </div>
</div>
    </div>

`;
  $('body').append(formphone);
    
   
}

function phoneok(){
    var varphoneok = `


       <!-- HTML-код модального окна -->
<div id="myModalSenksPhone" class="modal myModalSenksPhone fade" data-toggle="modal" tabindex="-1">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <!-- Основное содержимое модального окна -->
      <div class="modal-body">
         <h5>Спасибо за обращение вам перезвонят.</h5>
      </div>
      
    
  </div>
</div>
    </div>  

  `;
$("body").append(varphoneok);
   
} 

 
$('button.myModalBoxPhone').on('click', phone);
     
$('button').on('click', phoneok);


If I for example add Then nothing happens. How to be already tortured. Can anyone tell me what is wrong and most importantly where to read.

$('button.myModalSenksPhone ').fadeOute(3000);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Goryachev, 2017-01-23
@webirus

fadeOut

fadeOut %)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question