none
Internet Explorer 10 HtmlPage Incompatibility

    Question

  • Hello,

    I have been using Windows XP/Windows 7 for quite some time developing Silverlight Applications. After purchasing a 64bit Windows 8 laptop, I discovered an incompatibility with reading the Y offset for the browser window. I need this setting so that I can reposition child windows. The following works on XP, 7, and with Firefox/Chrome on Windows 8.

    HtmlPage.Window.GetProperty("pageYOffset")

    Only Internet Explorer 10 has an issue. The page offset is always ZERO. This is a serious issue as control windows, forms, etc. are not displayed where the user can see them.

    Is this a known issue?

    Is there a Silverlight workaround for IE 10?

    Thanks...


    Warren

    Friday, February 22, 2013 4:29 PM

Answers

  • After searching and reading a lot of JavaScript articles, I found the following code syntax that works for IE 10.

    document.documentElement.scrollTop;

    Assuming that the other browsers work with the above code, then I have a solution. If not, I will have to do some code switching in JavaScript.


    Warren

    Updated*******************

    I have documented the following 3 cases for reading the YOffset value for the browser in IE, Chrome, and Firefox. Can someone from Microsoft comment on whether or not the window.pageYOffset functionality will be restored for IE 10?

    Browser      window.pageYOffset        document.body.scrollTop      document.documentElement.scrollTop
    IE8, IE9        Valid                                   ? Did not test                         ? Did not test
    IE10             Undefined                           0                                            Valid
    Chrome        Valid                                   Valid                                       0
    Firefox          Valid                                   0                                            Valid

    • Marked as answer by highdownts Friday, February 22, 2013 9:44 PM
    • Edited by highdownts Saturday, February 23, 2013 11:02 AM
    Friday, February 22, 2013 9:42 PM

All replies

  • I wanted to add this information to show the issue using the following link:

    http://www.w3schools.com/js/tryit.asp?filename=try_win_pagexoffset

    The above link works with other browsers running in Windows 8, but fails with null return values. I am not sure why I get ZERO in Silverlight.

    I have tried using JavaScript methods from Silverlight to read the value for document.body.scrollTop and window.pageYOffset, but the scrollTop value is always ZERO and the pageYOffset is undefinded.

    I am at a loss for a way to get this value. Any ideas???

    Does anyone know if IE 10 and Windows 8 have additional security settings somewhere that might be causing this anomaly. I have searched, but have not found anything on the net or by looking at IE settings.

    Thank...


    Warren

    Friday, February 22, 2013 8:51 PM
  • After searching and reading a lot of JavaScript articles, I found the following code syntax that works for IE 10.

    document.documentElement.scrollTop;

    Assuming that the other browsers work with the above code, then I have a solution. If not, I will have to do some code switching in JavaScript.


    Warren

    Updated*******************

    I have documented the following 3 cases for reading the YOffset value for the browser in IE, Chrome, and Firefox. Can someone from Microsoft comment on whether or not the window.pageYOffset functionality will be restored for IE 10?

    Browser      window.pageYOffset        document.body.scrollTop      document.documentElement.scrollTop
    IE8, IE9        Valid                                   ? Did not test                         ? Did not test
    IE10             Undefined                           0                                            Valid
    Chrome        Valid                                   Valid                                       0
    Firefox          Valid                                   0                                            Valid

    • Marked as answer by highdownts Friday, February 22, 2013 9:44 PM
    • Edited by highdownts Saturday, February 23, 2013 11:02 AM
    Friday, February 22, 2013 9:42 PM
  • Hi Warren,


    Glad to hear you have found the solution. Thanks for sharing. We really appreciate your time and efforts. Hope your experience will help other community members facing similar problems.


    Thanks,


    Vincent Wang
    TechNet Community Support

    Monday, February 25, 2013 2:46 AM