Css 移动滚动在嵌套div上不起作用
我身体上有一个滚动条。 但是,当我试图从包含的div滚动到另一个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> //可滚动 //可以滚动身体 //无法滚动正文 有人知道原因吗
<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
});