Vitaliy 93 Posted November 9, 2017 Report Share Posted November 9, 2017 Здравствуйте. На сайте (HTML) есть две одинаковые формы со своими уникальными ID. К модальным окнам есть скрипт. Проблема в том что при нажатии на кнопку первое и второе модальное окно с контактной формой работают,, отправляют письма., но не закрывается (не сворачивается) http://joxi.ru/GrqgdNGcQWlLJ2 В консоли ошибка Uncaught TypeError: Cannot read property 'x' of undefined Вот скрипты отвечающие за это: $(document).ready(function() { var modal = document.getElementById("win_modal"); var span = document.getElementsByClassName("close")[0]; $('#modal').on('click', function () { modal.style.display = "block"; }); span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } }); $(document).ready(function() { var modal = document.getElementById("win_modal_2"); var span = document.getElementsByClassName("close")[0]; $('#modal_2').on('click', function () { modal.style.display = "block"; }); span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } }); Подскажите в чем проблема, если еще что-то нужно скину. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.