title: jQuery UI dialog positioning
body: <p>I am trying to use the <a href="http://docs.jquery.com/UI/Dialog" rel="noreferrer">jQuery dialog UI</a> library in order to position a dialog next to some text when it is hovered over.  The jQuery dialog takes a position parameter which is measured from the top left corner of the current viewport (in other words, <code>[0, 0]</code> will always put it in the upper left hand corner of your browser window, regardless of where you are currently scrolled to).  However, the only way I know to retrieve the location is of the element relative to the ENTIRE page.</p>
  
  <p>The following is what I have currently.  <code>position.top</code> is calculated to be something like 1200 or so, which puts the dialog well below the rest of the content on the page.</p>
  
  <pre><code>$(".mytext").mouseover(function() {
      position = $(this).position();
      $("#dialog").dialog('option', 'position', [position.top, position.left]);
  }
  </code></pre>
  
  <p>How can I find the correct position?</p>
  
  <p>Thanks!</p>