Advertisement
Guest User

popup.2

a guest
Jun 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. .modal {
  6. display: none;
  7. position: fixed;
  8. z-index: 1;
  9. padding-top: 100px;
  10. left: 0;
  11. top: 0;
  12. width: 100%;
  13. height: 100%;
  14. overflow: auto;
  15. background-color: rgb(0,0,0);
  16. background-color: rgba(0,0,0,0.7);
  17. }
  18.  
  19. .modal-content {
  20. position: relative;
  21. background-color: #ffffff;
  22. margin: auto;
  23. padding: 0;
  24. border: 1px solid #888;
  25. width: 80%;
  26. box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
  27. -webkit-animation-name: animatetop;
  28. -webkit-animation-duration: 0.4s;
  29. animation-name: animatetop;
  30. animation-duration: 0.4s
  31. }
  32.  
  33. @-webkit-keyframes animatetop {
  34. from {bottom:-300px; opacity:0}
  35. to {top:0; opacity:1}
  36. }
  37.  
  38. @keyframes animatetop {
  39. from {bottom:-300px; opacity:0}
  40. to {top:0; opacity:1}
  41. }
  42.  
  43. .close {
  44. color: white;
  45. float: right;
  46. font-size: 28px;
  47. font-weight: bold;
  48. }
  49.  
  50. .close:hover,
  51. .close:focus {
  52. color: #000;
  53. text-decoration: none;
  54. cursor: pointer;
  55. }
  56.  
  57. .modal-header {
  58. background: red; /* For browsers that do not support gradients */
  59. background: -webkit-linear-gradient(red, yellow); /* For Safari 5.1 to 6.0 */
  60. background: -o-linear-gradient(red, yellow); /* For Opera 11.1 to 12.0 */
  61. background: -moz-linear-gradient(red, yellow); /* For Firefox 3.6 to 15 */
  62. background: linear-gradient(red, yellow); /* Standard syntax */
  63. }
  64.  
  65. .modal-body {padding: 2px 16px;}
  66.  
  67. .modal-footer {
  68. padding: 2px 16px;
  69. background-color: #5cb85c;
  70. color: white;
  71. }
  72. </style>
  73. </head>
  74.  
  75. <body>
  76.  
  77. <button id="myBtn">knopka</button>
  78.  
  79. <div id="myModal" class="modal">
  80.  
  81. <div class="modal-content">
  82. <div class="modal-header">
  83. <span class="close">&times;</span>
  84. <h1>golova<h1>
  85. </div>
  86. <div class="modal-body">
  87. <p>telo</p>
  88. </div>
  89. <div class="modal-footer">
  90. <h2>nogi</h2>
  91. </div>
  92. </div>
  93.  
  94. </div>
  95.  
  96. <script>
  97. var modal = document.getElementById('myModal');
  98.  
  99. var btn = document.getElementById("myBtn");
  100.  
  101. var span = document.getElementsByClassName("close")[0];
  102.  
  103. btn.onclick = function() {
  104. modal.style.display = "block";
  105. }
  106.  
  107. span.onclick = function() {
  108. modal.style.display = "none";
  109. }
  110.  
  111. window.onclick = function(event) {
  112. if (event.target == modal) {
  113. modal.style.display = "none";
  114. }
  115. }
  116. </script>
  117.  
  118. </body>
  119. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement