程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)?

开发过程中遇到WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)的问题如何解决?下面主要结合日常开发的经验,给出你关于WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)的解决方法建议,希望对你解决WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)有所启发或帮助;

We checked again on a new Machine also running windows 8 and the error was gone, after some checks we determined that the new Machine had some new updates for windows 8 installed. We went to check for updates on the Surface and after applying all updates the Error seems to be gone.

Scrolling is smooth Now. Same executable no changes, so i guess it was some BUG in the runtime libs after all.

解决方法

We use the WPF WebBrowser control to display an embedded page. On Windows 8 we
observe a strange jumping behavior of elements with css position:fixed while
scrolling.

@H_675_16@WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows
8)

The same page works fine in IE10 on Windows 8 (also FF,ChromE) and in the WPF
WebBrowser control on Windows 7.

Has anyone seen this behavior before and knows a fix for the jumping motion?

Is it possible the .NET Version 4.5 used on the test machine (Surface with Win
8) be the Problem as compared to the .Net Version 4 on the dev machine?

The Development Environment:

  • Windows 7
  • @H_501_33@microsoft Visual studio 2010 Version 10.0.30319.1 RTMRel @H_501_33@microsoft .NET Framework Version 4

The Test Environment:

  • Surface
  • Windows 8
  • @H_501_33@microsoft .NET Framework Version 4.5

Client XAML:

<Window x:Class="EmbeddedBrowserTest.MainWindow"
        xmlns="http://scheR_666_11845@as.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://scheR_666_11845@as.microsoft.com/winfx/2006/xaml"
        title="MainWindow" Height="350" Width="525">
    <Grid>
        <WebBrowser HorizontalAlignment="Stretch" Name="webBrowser" VerticalAlignment="Stretch" Grid.Row="1" />
    </Grid>
</Window>

Demo Page HTML:

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>minimal position fixed example</title>
    <style>
        body {
            margin: 0px
        }           
        .header{
            height: 60px;
            width: 960px;
            BACkground-color: #cccccc;
            top: 0px;
            left: 0px;
            position: fixed;
            z-index: 10;
        }    
        .content{
            padding-top: 60px;
            height: 420px;
            width: 960px;
            BACkground-color: lightsteelblue;
        }    
    </style>
</head>

<body>
    <div class="header">
        header
    </div>    
    <div class="content">
        content <br> 1 <br> 2 <br> 3 <br> 4 <br> 5 <br> 6 <br> 7 <br>
    </div>                
</body>

</html>

大佬总结

以上是大佬教程为你收集整理的WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)全部内容,希望文章能够帮你解决WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。