Bootstrap Tutorial - Create model dialog








The following code shows how to create model dialog.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<style type='text/css'>
.popover {<!--from   ww  w  .  ja  v  a 2  s  .c  om-->
  z-index: 9999;
  position: fixed;
}
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
   $('a[rel=popover]').popover();
});//]]>  
</script>
</head>
<body style='margin:30px'>
  <p>Click to launch modal dialog:</p>
  <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch
    demo modal</a>
  <div id="myModal" class="modal hide fade">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"
        aria-hidden="true">&times;</button>
      <h3>Modal header</h3>
    </div>
    <div class="modal-body">
      <a class="btn pop" 
         rel="popover" 
         href="#"
         data-original-title="A Title" 
         data-container="body"
         data-content="This is a test.">
         Click to toggle popover </a>
    </div>
    <div class="modal-footer">
      <a href="#" class="btn">Close</a> <a href="#" class="btn btn-primary">Save
        changes</a>
    </div>
  </div>
</body>
</html>

Click to view the demo