小编Vec*_*ign的帖子

添加向左/向右滑动到网页,但使用默认向上/向下滑动

我正在使用padilicious来检测将在iOS和桌面上查看的网页的滑动手势.它可以很好地向我/我网站的上一页和下一页左/右滑动.但是,当向上/向下滑动时,它似乎会覆盖iPhone/iPad中的默认行为.我想要一个向上/向下滑动来滚动页面,当我没有运行时它会这样做.只是让代码忽略向上/向下滑动似乎不起作用.

我一直以来的padilicious代码部分

function processingRoutine() {
    var swipedElement = document.getElementById(triggerElementID);
    if ( swipeDirection == 'left' ) {
        document.location = document.getElementById('nextPage').href;
    } else if ( swipeDirection == 'right' ) {
        document.location = document.getElementById('prevPage').href;
    } else if ( swipeDirection == 'up' ) {
        return;
    } else if ( swipeDirection == 'down' ) {
        return;
    }


}
Run Code Online (Sandbox Code Playgroud)

html javascript swipe ios

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

html ×1

ios ×1

javascript ×1

swipe ×1