I was working on a new MVC MVC website and integrated some of the awesome jquery user interface components.
ive tested it in IE8, FF, opera and Chrome, and everything looks good. As soon as I test in IE7, its dialogs that cause the problem are amazing.
basically it happens that the user you click opens a dialog box, the page will scroll immediately at the bottom of the page. This is especially bad if the page is quite long.
this only happens in IE7 (and probably 6, but I'm not even going there!).
I spent several hours reading the forums, and this seems to them not the only one.
I created a dirty hack that doesn't get carried away, but it works.
onclick="SignIn(); <% if(ModelHelperClass.CheckForOldIEVersion() == true) Response.Write("window.scrollTo(0, 0);"); %> return false;">
Has anyone else had this problem and solved it without resorting to dirty hacks?
im using jquery-ui-1.8.custom.min.js and jquery-1.4.2.min.js
any help is most appreciated
Truegilly
Update ---
Hi, thanks for the reply -
at the top of my page I have this ad ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I am including these files ....
<link href="/Scripts/css/blitzer/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="/Scripts/jquery-1.4.2.min.js" ></script> <script type="text/javascript" src="/Scripts/jquery-ui-1.8.1.custom.min.js" ></script>
here is my signin function - the other dialogs are pretty similar.
// 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 + '&Password=' + Password; // AJAX here.... // when the user clicks sign in, the form is submitted //$("#SignInForm").submit(); }, Cancel: function () { $(this).dialog('close'); } } }); }
as I said, it works fine in all browsers except IE7