
解决方式是,我把左右滚动的事件添加到了Body上面,而上下活动的使用了DIV的垂直滚动。上代码:
$("#body").swipe( { fingers:"all", swipeLeft:swipe1, swipeRight:swipe2} );function swipe1(event, direction, distance, duration, fingerCount) { tab_shipu(-1); //向左滑动你要执行的动作 } function swipe2(event, direction, distance, duration, fingerCount) {tab_shipu(1);//向右滑动你要执行的动作}然后上下滚动条我设置div的滚动;<div id="cook" class="cook"></div><style>.cook{overflow: auto;}</style>设置body和div的默认高度代码:$("body").css("height",document.body.scrollHeight);$(".cook").css("height",document.body.scrollHeight-$("#cook").position().top);以上就是解决左右滑动和垂直滚动条冲突的方法,希望对大家的学习有所帮助。