Standard modal. Includes a close button in the top left so the user can dismiss the overlay.
<button class="o-overlay-trigger o-buttons o-buttons--secondary o-buttons--big" data-o-overlay-id="overlay" data-o-overlay-src="#overlay" data-o-overlay-heading-title="We're not having trouble updating" data-o-overlay-heading-shaded="false" data-o-overlay-modal="true" data-o-overlay-preventclosing="false" data-o-overlay-zindex="20" aria-pressed="false" aria-haspopup="true">Launch overlay</button>
<script type="text/template" id="overlay">
<div class='demo-overlay'>
<p>Everything is great. This demo modal is here to tell you we're currently experiencing no technical difficulties.</p>
<button onclick="window.location.reload(true)" class="o-buttons o-buttons--secondary">OK</button>
</div>
</script>
Fullscreen modal. The user can dismiss the overlay with the close button or back button.
<button class="o-overlay-trigger o-buttons o-buttons--secondary o-buttons--big" data-o-overlay-id="overlay" data-o-overlay-src="#overlay" data-o-overlay-heading-title="Welcome to this fullscreen overlay" data-o-overlay-heading-shaded="false" data-o-overlay-fullscreen="true" data-o-overlay-modal="true" data-o-overlay-preventclosing="false" data-o-overlay-zindex="20" aria-pressed="false" aria-haspopup="true">Launch fullscreen overlay</button>
<script type="text/template" id="overlay">
<p>This fullscreen overlay may be dismissed with the back button or with the cross icon.</p>
<button onclick="window.location.reload(true)" class="o-buttons o-buttons--secondary">OK</button>
</script>
Modal without a dismiss button in the top right. This should be used where the user has to make a choice or confirm they've seen something.
<button class="o-overlay-trigger o-buttons o-buttons--secondary o-buttons--big" data-o-overlay-id="overlay" data-o-overlay-src="#overlay" data-o-overlay-heading-title="You've changed region" data-o-overlay-heading-shaded="true" data-o-overlay-modal="true" data-o-overlay-preventclosing="true" aria-pressed="false" aria-haspopup="true">Launch overlay</button>
<script type="text/template" id="overlay">
<div class='demo-overlay'>
<p>We've detected that your location has changed. Would you like to switch to the International Edition?</p>
<button class='demo-button o-buttons o-buttons--secondary' onclick="window.location.reload(true)">Stay with UK edition</button><button class='demo-button o-buttons o-buttons--secondary'>Switch to International</button>
</div>
</script>
O-overlay can also be used to create overlays that don't sit in the front centre of the screen but appear in a specific area.
<div class="content">
<div class="blur left">
<h2>What is Lorem Ipsum?</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<h2>Why do we use it?</h2>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</div>
<div class="right-rail">
<p>Hello! this is the right rail</p>
</div>
</div>