In this paper, we share the solution of the conflict between the jquery.touchswipe and the vertical scroll bar, and the details are as follows
Just need HTML5 to do a function that can be switched around, but to retain the upper and lower scroll bar function. I am in the mobile end of the use of Jquery.touchswipe plug-ins, Internet search for a long time did not see the corresponding solution, can only modify their own, and finally can be used.
Let's go to the last picture:
The solution is that I add the left and right scrolling events to the body, and the top and bottom activities use the vertical scrolling of the div. Code on:
$ ("#body"). Swipe ({fingers: ' All ', Swipeleft:swipe1, swiperight:swipe2});
function Swipe1 (event, direction, distance, duration, fingercount) {
Tab_shipu (-1);//left-slide the action you want to perform
}
function Swipe2 (event, direction, distance, duration, fingercount) {
Tab_shipu (1); Slide to the right the action you want to perform
}
Then scroll up and down the bar I set div scrolling;
<div id= "Cook" class= "Cook" ></div>
<style>
cook{
overflow:auto;
</style>
Set the default height code for body and DIV:
$ ("Body"). CSS ("height", document.body.scrollHeight);
$ (". Cook"). CSS ("height", document.body.scrollheight-$ (' #cook '). Position (). top);
The above is to solve the left and right sliding and vertical rolling conflict of the method, I hope to help you learn.