Modal Web Boxes


Click on the following to pop-up the appropriate boxes:

Use these Modal Web Boxes on your site to easily add a warning, notification, or collect information.

How to Get Started:

  1. Link to your current jQuery library or link to the Google jQuery library from within the <head> of the page:
    <script type="text/javascript" src=""></script>
  2. Either copy and paste the contents of the styles.css sheet or upload styles.css and add this code to the <head> of the page (making sure to update the relative link to be in the right location):
    <link rel="stylesheet" type="text/css" href="styles.css" />
  3. Copy all of the images from the included images folder and add them to an images folder on your site (or any directory of your choosing).
  4. Copy the html of modal box you'd like to use, beginning with the div that has the "modal-box" class and ending with the closing tag for that div:
    		<div id="warning" class="modal-box wrapper"><div class="inside light-yellow">
    <img src="images/warning.png" />
    <h3>Oops! There's been a problem.</h3>
    <p>Sorry, but we don't appear to be able to do what you asked. Please submit a bug report.</p>
    <span class="button white dismiss"><span>Dismiss</span></span>
    <a href="" class="button yellow"><span>Send Bug Report</span></a>
  5. Add something that will trigger the modal box to pop-up. In our case, we created a span. Change the rel attribute to have the id of the modal div you want to be triggered:
    <span rel="#warning" class="modal-link"><span>Show Warning Box</span></span>>
  6. Add some javascript to your <head> tag - after calling the jQuery library:
    	<script type="text/javascript">
    $(document).ready( function(){
    // Hide all Modal Boxes
    // Display appropriate box on click - adjust this as required for your website
    $('span.modal-link').click(function() {
    var modalBox = $(this).attr('rel');
    // Multiple ways to close a Modal Box
    $('span.modal-close').click(function() {
    $('span.dismiss').click(function() {
    $('').click(function() {
    // **** If you need to save or submit information - add your appropriate ajax code here
  7. Now, when you click on that span that says Show Warning Box, the associated warning box should appear. Be sure to update the jQuery scripts to work for your specific needs. For example, you may want a specific box to display on load instead of on a click. You can consult the full jQuery documentation to adapt the code to your exact needs.


We've coded these Modal Web Boxes to be as customizable as possible. Please take a look at the styles.css sheet to see that you may change the width and height of the boxes as well as the style of the buttons.