Last active
March 7, 2018 22:31
-
-
Save svgerasimov/f286bd60d182e53b15cbd56e76750167 to your computer and use it in GitHub Desktop.
Модальное окно
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button onclick="showPopup();">Нажми на меня, чтобы показать форму обратной связи</button> | |
<div class="popup"> | |
<div class="popup_bg"></div> | |
<div class="form"> | |
<form> | |
<input type="text" name="name" placeholder="Ваше имя"> | |
<input type="text" name="email" placeholder="Ваша почта"> | |
<textarea name="message" id="message" cols="30" rows="10" placeholder="Ваше сообщение"></textarea> | |
<input type="submit" value="Отправить"> | |
</form> | |
</div> | |
</div> | |
$(document).ready(function() { // Ждём загрузки страницы | |
$(".popup_bg").click(function(){ // Событие клика на затемненный фон | |
$(".popup").fadeOut(500); // Медленно убираем всплывающее окно | |
}); | |
}); | |
function showPopup() { | |
$(".popup").fadeIn(500); // Медленно выводим изображение | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment