This article mainly introduces how to quickly solve jquery. touchSwipe sliding between left and right conflicts with the vertical scroll bar. Interested friends can refer to this article to share jquery. the touchSwipe sliding left and right conflicts with the vertical scroll bar. The specific content is as follows:
Html5 is required to implement a switch between the left and right, but the up and down scroll bars must be retained. I used the jquery. touchSwipe plug-in on the mobile end. I haven't seen the corresponding solution for a long time on the Internet. I can only modify it myself, and I can use it at last.
First, the previous figure:
The solution is to add the left and right scrolling events to the Body, while the vertical scrolling of the up and down actions is used. Code:
$ ("# Body "). swipe ({fingers: 'all', swipeLeft: swipe1, swipeRight: swipe2}); function swipe1 (event, direction, distance, duration, fingerCount) {tab_shipu (-1 ); // Slide left the action you want to execute} function swipe2 (event, direction, distance, duration, fingerCount) {tab_shipu (1); // slide right the action you want to execute}
Then I set p to scroll up and down the scroll bar;
Set the default height code for the body and p:
$("body").css("height",document.body.scrollHeight);$(".cook").css("height",document.body.scrollHeight-$('#cook').position().top);
The above is the solution to the conflict between the left and right sliding and the vertical scroll bar. I hope it will help you learn.