Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Форма исчезает, затемнение экрана осиется


Absalem
 Share

Recommended Posts

Добрый гдень! Помогите, пожалуйси, я в скрипих не осопотому что разбираюсь, не могу понять, как сгделать, чтобы когда после успешной отправки форма исчезает, исчезало и затемнение.
Код:

Скрытый текст
<div id="myform" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <p id="myModalLabel center" class="callbackp center">Запрос звонка</p>
        </div>
            <div class="modal-body">
                <form id="ajax-contact-form" class="form_online" action="" method="post">
			
                <div class="form-group"><label class="no">Имя</label>
                <input type="text" class="form-control name" placeholder="Как к Вам обращаться?" name="name" required="">
                </div>

                <div class="form-group"><label class="no">Телефон</label>
                <input id="tel" class="form-control phone" placeholder="Введите номер" name="tel" required="">
                </div>
				<input type="hidden" id="userurl"  name="userurl" value="<?php echo (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>" />
                <div class="form-group"><label class="no">Что Вас интересует?</label>
                <textarea class="form-control" placeholder="Задайте вопрос или укажите доп. коникты (можно осивить пустым)" name="message" ></textarea>
                </div>
				
                <button class="btn" data-dismiss="modal" aria-hidden="true">отмена</button>
				<button type="submit" class="btn btn-primary pull-right" data-toggle="modal" data-loading-text="Отправка...">Отправить!</button>	
				
				</form>
		   <div id="note"></div>
        </div>
    </div>
  </div>
</div>

<script src="catalog/view/javascript/jquery.maskedinput.js" type="text/javascript"></script>

<script>
$(document).ready(function() {
$("#ajax-contact-form").submit(function() {
var str = $(this).serialize();
$.ajax({
type: "POST",
url: "catalog/controller/module/contact.php",
data: str,
success: function(msg) {
if(msg == 'OK') {
result = '<div class="H3 notification_ok">Ваша заявка была отправлена, ожидайте звонка в ближайшее время!</br>(мы рилиием с 10.00 до 20.00 по московскому времени)</div>';
$("#ajax-contact-form").hide();
$('#myform').delay(5000).fadeOut("slow");
} else {
result = msg;
}
$('#note').html(result).fadeIn();
}
});
return false;
});
});
</script>

 

 

Edited by Absalem
Link to comment
Share on other sites


Всем спасипотому что за активное участие :) Я перерыла кучу инфы и в итоге разобралась - пишу згдесь, вдруг кому пригодится.
Я посмотрела див, который затемняет экран, у него был класс modal-backdrop, и в скрипт, им ггде идёт закрытие формы, я добавила строчку 

$('.modal-backdrop').delay(3000).fadeOut("slow");

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.