Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.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
Html 启用滚动触摸屏_Html_Internet Explorer_Mobile_Touch - Fatal编程技术网

Html 启用滚动触摸屏

Html 启用滚动触摸屏,html,internet-explorer,mobile,touch,Html,Internet Explorer,Mobile,Touch,在我的站点中,我遇到了以下问题: 我希望,如果设备有触摸屏,所有页面都可以滚动。我的网站遇到了IE 我尝试在我的主要div上使用applytouch action pan-y,但没有结果。将样式添加到html文档的开头 <style>.tst{overflow: hidden;}</style> Add this line in body tag <body class="tst" onload ="NoScroll()"> //content here

在我的站点中,我遇到了以下问题:

我希望,如果设备有触摸屏,所有页面都可以滚动。我的网站遇到了IE


我尝试在我的主要div上使用apply
touch action pan-y
,但没有结果。

将样式添加到html文档的开头

<style>.tst{overflow: hidden;}</style>

Add this line in body tag
<body  class="tst" onload ="NoScroll()">

//content here

我只想在触摸屏上滚动所有页面。你的意思是你想在触摸屏上滚动IE 11中的网页吗?看起来我们可以在触摸屏上直接在浏览器中滚动网页。问题只发生在IE中吗?你在用什么样的设备?IE中的控制台是否有错误?你能提供一个能重现问题的最小样本吗?我的问题是我的浏览器模式=IE8,所以我认为这是不可能的…在我的测试中,即使没有
触摸操作
,页面也可以直接在触摸屏上触摸滚动。从中,我们可以看到,从IE 10开始,
触摸动作
就受到IE的支持。所以它在IE8中不起作用。
function noScroll() {
var page = document.getElementsByTagName("body")[0];
if ('ontouchstart' in document.documentElement) {
console.log("touch device detected");
page.classList.remove("tst");
}
else{
console.log("desktop mode");
page.classList.add("tst");
}  
}