1. 先说css,主要排查 overflow:hidden;

检查也有一定的顺序,检查超出高度的标签是否用了overflow:hidden;最好先检查html或body是不是加了height:100%overflow:hidden;然后再看包裹在最外边的元素是否加了overflow:hidden;

解决方法:改为 overflow:auto;

2. 再说下js,主要是有在touchstart、touchmove或touchend等事件中的阻止默认事件的原因

$("#myCarousel").on("touchstart", function (e) {
    e.preventDefault();
    startX = e.originalEvent.changedTouches[0].pageX;
    startY = e.originalEvent.changedTouches[0].pageY;
})

这种代码其中 e.preventDefault(); 会阻止掉默认的滚动行为。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐