0
我在我的機身上有一個滾動條。 但我不能滾動體,當我試圖從包含到另一個格移動滾動無法在嵌套Divs上工作
<body> //scrollable
<div> //can scroll the body
<div> //can not scroll the body
</div>
</div>
</body>
有沒有人知道爲什麼一個DIV滾動?
我在我的機身上有一個滾動條。 但我不能滾動體,當我試圖從包含到另一個格移動滾動無法在嵌套Divs上工作
<body> //scrollable
<div> //can scroll the body
<div> //can not scroll the body
</div>
</div>
</body>
有沒有人知道爲什麼一個DIV滾動?
我使用這個庫解決它:http://labs.rampinteractive.co.uk/touchSwipe
//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
});
其實你的問題不符合標準,你的回答也沒有正確回答你的問題...... :) –
要麼把你的HTML/CSS代碼或創建您提出的問題的jsfiddle,它是接近不可能理解你的問題,你迄今爲止發佈的內容: ) – ravk