title: Jquery UI Dialog - when opened IE7 Browser moves instantly to the bottom of the page
body: <p>i have been working on a new .net MVC site and have integrated some of the awesome jquery UI components.</p>
  
  <p>ive been testing it in IE8, FF, opera and Chrome and all looks well. Once I test in IE7, surprisingly its the dialogs that are causing a problem.</p>
  
  <p>basically what’s happening is that one you user clicks to open a dialog the page will scroll immediately to the bottom of the page. This is especially bad if the page is quite long.</p>
  
  <p>this only happens in IE7 (and probably 6 but im not even going there!).</p>
  
  <p>I have spend a few hours reading forums and it seems im not the only one.</p>
  
  <p>I have created a dirty hack which im not keen on but it does work.</p>
  
  <pre><code>onclick="SignIn();  &lt;% if(ModelHelperClass.CheckForOldIEVersion() == true) Response.Write("window.scrollTo(0, 0);"); %&gt; return false;"&gt;
  </code></pre>
  
  <p>has anyone else had this issue and resolved it without resorting to dirty hacks ?</p>
  
  <p>im using jquery-ui-1.8.custom.min.js and jquery-1.4.2.min.js</p>
  
  <p>any help is most appreciated</p>
  
  <p>Truegilly</p>
  
  <p>Update---</p>
  
  <p>hello, thanks for the response - </p>
  
  <p>at the top of my page i have this declaration...</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  </code></pre>
  
  <p>i am including these files....</p>
  
  <pre><code>&lt;link href="/Scripts/css/blitzer/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" /&gt;
  &lt;script type="text/javascript" src="/Scripts/jquery-1.4.2.min.js" &gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/Scripts/jquery-ui-1.8.1.custom.min.js" &gt;&lt;/script&gt;
  </code></pre>
  
  <p>here is my signin function - the other dialogs are pretty similar</p>
  
  <pre><code>// Sign in to the site
  function SignIn() 
  {
      $("#SignIn").dialog({
          bgiframe: true,
          modal: true,
          resizable: false,
          buttons: {
  
              'Sign In': function () {
  
                  // the username and password
                  var Username = $("#Username").val();
                  var Password = $("#Password").val();
  
                  var dataString = 'Username=' + Username + '&amp;Password=' + Password;
  
                  // AJAX here....
  
                  // when the user clicks sign in, the form is submitted                
                  //$("#SignInForm").submit();
              },
              Cancel: function () {
                  $(this).dialog('close');
              }
          }
      });
  }
  </code></pre>
  
  <p>as i say, it works fine in all browsers except IE7</p>