Full width modal with iframe

Full width modal with iframe


I want to add the following to a code snippet but it is not working

you can see what it is suppose to do here

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_overlay2

Your code snippet functionality does not work like most other similar products
(as an example the visual editor in wordpress)

If you past the code into a code snippet you will see what I mean

Thanks for any help with this
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <style>
  6. body {
  7.   font-family: 'Lato', sans-serif;
  8. }

  9. .overlay {
  10.   height: 0%;
  11.   width: 100%;
  12.   position: fixed;
  13.   z-index: 1;
  14.   top: 0;
  15.   left: 0;
  16.   background-color: rgb(0,0,0);
  17.   background-color: rgba(0,0,0, 0.9);
  18.   overflow-y: hidden;
  19.   transition: 0.5s;
  20. }

  21. .overlay-content {
  22.   position: relative;
  23.   top: 8%;
  24.   overflow: hidden;
  25.   padding-top: 100%
  26. }

  27. .overlay-content iframe {
  28.   position: absolute;
  29.     top: 0;
  30.     left: 0;
  31.     width: 100%;
  32.     height: 78%;
  33.     border: 0;
  34. }

  35. .overlay a {
  36.   padding: 8px;
  37.   text-decoration: none;
  38.   font-size: 36px;
  39.   color: #818181;
  40.   display: block;
  41.   transition: 0.3s;
  42. }

  43. .overlay a:hover, .overlay a:focus {
  44.   color: #f1f1f1;
  45. }

  46. .overlay .closebtn {
  47.   position: absolute;
  48.   top: 0;
  49.   right: 45px;
  50.   font-size: 60px;
  51.   margin-top: -5px;
  52. }

  53. @media screen and (max-height: 450px) {
  54.   .overlay {overflow-y: auto;}
  55.   .overlay a {font-size: 20px}
  56.   .overlay .closebtn {
  57.   font-size: 40px;
  58.   top: 15px;
  59.   right: 35px;
  60.   }
  61. }
  62. </style>
  63. </head>
  64. <body>

  65. <div id="myNav" class="overlay">
  66.   <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
  67.   <div class="overlay-content">
  68.    <iframe frameborder="0"  src='https://forms.zohopublic.com/greaterthanthesum/form/ContactForm/formperma/N2N8CmJYyQUPVOgfRQRi1R0iplUGVyEng16Cm1JGpz0'></iframe>
  69.   </div>
  70. </div>

  71. <h2>Fullscreen Overlay Nav Example</h2>
  72. <p>Click on the element below to open the fullscreen overlay navigation menu.</p>
  73. <p>In this example, the navigation menu will slide downwards from the top:</p>
  74. <span style="font-size:30px;cursor:pointer" onclick="openNav()">&#9776; open</span>

  75. <script>
  76. function openNav() {
  77.   document.getElementById("myNav").style.height = "100%";
  78. }

  79. function closeNav() {
  80.   document.getElementById("myNav").style.height = "0%";
  81. }
  82. </script>
  83.      
  84. </body>
  85. </html>