title: Keep divs at fixed position within dialog
body: <p>At the top and bottom of the visible area of the jQueryUI dialog I have divs, represented by the gray boxes, the <code>.nav</code> elements in the snippet, and I want them to remain in a fixed position when you scroll within the dialog.  I set <code>position: absolute</code> for the gray boxes, yet they still scroll with the rest of the content in the dialog.  How can I keep them at a fixed position within the dialog?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
   var opts = {
     modal: true,
      height:300,
    };
    
    $('#wrapper').dialog(opts);
    $('#wrapper').dialog('open');
  
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.images {
    z-index: 1;
  }
  
  .image {
    display: inline-block;
    border: 1px solid black;
    width: 100%;
    height: 500px;
  }
  
  .nav {
    width: 90%;
    height: 30px;
    z-index: 2;
    background-color: rgba(192, 192, 192, 0.7);
    position: absolute;
  }
  
  .top {
    top: 0px;
  }
  
  .bottom {
    bottom: 0px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" /&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"&gt;&lt;/script&gt;
  
  &lt;div id='wrapper'&gt;
    &lt;div class='top nav'&gt;
    &lt;/div&gt;
  
    &lt;div class='bottom nav'&gt;
    &lt;/div&gt;
  
    &lt;div class='images'&gt;
      &lt;div class='image'&gt;
      &lt;/div&gt;
  
      &lt;div class='image'&gt;
      &lt;/div&gt;
  
      &lt;div class='image'&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>