<html>
<head>
  <title>Modal init</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/andreyshpigunov/auto/dist/auto.css" />
</head>
<body class="p4">
  <!-- 
    Button or other element to call the modal window
    must contain the attribute data-modal="modalID"
  -->
  <a class="button" data-modal="modal">Show modal</a>
  <!-- 
    Modal window template
    After initialization, the modal window moves to the end of the body tag,
    or to the container with the .modal-here class
  -->
  <div id="modal" class="modal-content">
    <!-- Modal content -->
    <!-- Custom close button (must contain the .modal-customClose class): -->
    <a class="button modal-close">Close</a>
    <!--
      If you open an additional window while the current one is active,
      it will open on top of the current one:
    -->
    <a class="button" data-modal="modalChild">Another window</a>
  </div>
  <div id="modalChild" class="modal-content">
    <p>This is another window :)</p>
    <hr/>
    <a class="button modal-close">Close it</a>
  </div>
  <script src="https://cdn.jsdelivr.net/gh/andreyshpigunov/auto/dist/auto.js"></script>
  <script>auto.init()</script>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.