Guest User

Untitled

a guest
Feb 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <ul>
  2. <li id='signUp'>Sign Up</li>
  3. <li id="logIn">Log In</li>
  4. </ul>
  5.  
  6. <div id="logInModal" class="modal">
  7. <div class="modal-content">
  8. sssssss
  9. </div>
  10. </div>
  11.  
  12. <div id="signUpModal" class="modal">
  13. <div class="modal-content">
  14. sssssss
  15. </div>
  16. </div>
  17.  
  18. .modal {
  19. display: none;
  20. position: fixed;
  21. z-index: 1;
  22. padding-top: 100px;
  23. left: 0;
  24. top: 0;
  25. width: 100%;
  26. height: 100%;
  27. overflow: auto;
  28. background-color: rgb(0,0,0);
  29. background-color: rgba(0,0,0,0.4);
  30. }
  31.  
  32. .modal-content {
  33. background-color: #fefefe;
  34. margin: auto;
  35. padding: 20px;
  36. border: 1px solid #888;
  37. width: 80%;
  38. }
  39.  
  40. var logInModal = document.getElementById('logInModal');
  41. var logInButton = document.getElementById("logIn");
  42.  
  43. logInButton.onclick = function() {
  44. logInModal.style.display = "block";
  45. }
  46.  
  47. window.onclick = function(event) {
  48. if (event.target == logInModal) {
  49. logInModal.style.display = "none";
  50. }
  51. }
  52.  
  53. var signUpModal = document.getElementById('signUpModal');
  54. var signUpButton = document.getElementById("signUp");
  55.  
  56. signUpButton.onclick = function() {
  57. signUpModal.style.display = "block";
  58. }
  59.  
  60. window.onclick = function(event) {
  61. if (event.target == signUpModal) {
  62. signUpModal.style.display = "none";
  63. }
  64. }
Add Comment
Please, Sign In to add comment