Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.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 移动滚动在嵌套div上不起作用_Css_Mobile_Scroll - Fatal编程技术网

Css 移动滚动在嵌套div上不起作用

Css 移动滚动在嵌套div上不起作用,css,mobile,scroll,Css,Mobile,Scroll,我身体上有一个滚动条。 但是,当我试图从包含的div滚动到另一个div时,无法滚动正文 <body> //scrollable <div> //can scroll the body <div> //can not scroll the body </div> </div> </body> //可滚动 //可以滚动身体 //无法滚动正文 有人知道原因吗

我身体上有一个滚动条。 但是,当我试图从包含的div滚动到另一个div时,无法滚动正文

    <body> //scrollable
      <div> //can scroll the body
        <div> //can not scroll the body
        </div>
      </div>
   </body>
//可滚动
//可以滚动身体
//无法滚动正文

有人知道原因吗?

我使用此库修复它:


无论是编写html/css代码,还是创建一个JSFIDLE问题,都几乎不可能理解您的问题到目前为止发布的内容:)事实上,您的问题没有达到标准,您的答案也没有正确回答您的问题……:)
    //scrolling issue
    $("#myDiv").swipe( {
        //Generic swipe handler for all directions
        swipeStatus:function(event, phase, direction, distance, duration, fingers) {
            var curY = window.scrollY;
            if(direction == "up") window.scrollTo(0, curY + 10);
            if(direction == "down") window.scrollTo(0, curY - 10)
        },
        swipeUp:function(event, direction, distance, duration, fingerCount) {
            window.scrollTo(0, distance);
        },
        swipeDown: function(event, direction, distance, duration, fingerCount) {
            window.scrollTo(0, window.scrollY - distance);
        },
        threshold: 10,
        cancelThreshold: 10
    });