Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 禁用Metro IE中的导航滑动_Css_Internet Explorer_Microsoft Metro - Fatal编程技术网

Css 禁用Metro IE中的导航滑动

Css 禁用Metro IE中的导航滑动,css,internet-explorer,microsoft-metro,Css,Internet Explorer,Microsoft Metro,我正在尝试禁用导航刷。 我不希望网页在用户向左或向右滑动时返回或前进 我注意到我们可以在html元素上将touch操作设置为none,以防止这种行为。 但是,当滚动有一些溢出的子元素时,它将“链接”滚动,然后允许向后导航 因此,我考虑添加-ms scroll-chaining:在html元素上没有,但它只在元素滚动时起作用。 因此,添加溢出:在html上滚动实际上做到了这一点。但现在我在其他浏览器上显示了滚动条 正确的方法是什么 html { -ms-touch-acti

我正在尝试禁用导航刷。 我不希望网页在用户向左或向右滑动时返回或前进

我注意到我们可以在html元素上将touch操作设置为none,以防止这种行为。 但是,当滚动有一些溢出的子元素时,它将“链接”滚动,然后允许向后导航

因此,我考虑添加-ms scroll-chaining:在html元素上没有,但它只在元素滚动时起作用。 因此,添加溢出:在html上滚动实际上做到了这一点。但现在我在其他浏览器上显示了滚动条

正确的方法是什么

    html {
        -ms-touch-action: none; /* Doesn't work if scrolling from child element */
        -ms-scroll-chaining: none; /* Works only with the next line */
        overflow: scroll; /* With this line all the other browsers have a scrollbar */
    }
你试过了吗

body, html {
   -ms-touch-action:none;
}
对于每个可以滚动的类(Y轴)应用

-ms滚动链接:无

在我的项目中,我们有一个特殊的类,用于滚动舒适的内容:

.scroll-y {
    overflow-y: auto;
    overflow-x: hidden;
    -ms-scroll-chaining: none;
}
为我工作

我用了这个:

@media screen and (-ms-high-contrast: none) {
    // Windows 8+ IE only
    html {
        overflow-x: scroll;
        -ms-touch-action: none; 
        -ms-overflow-style: none;
        -ms-scroll-chaining: none; 
    }
}

控制人们的浏览器并尝试禁用特定功能不是一个好主意。尤其是航海和历史。但我可以告诉你,你可以在javascript中查看HTML5的历史API,并检测导航事件。这太有限制了。我仍然需要-ms滚动链接来处理我的元素。链接在网站上是好的和重要的。