The problem is as follows:
The general handling of such problems will have a property: "Event.preventdefault ()", but if used directly will cause the page's internal scrolling also to fail to be able to scroll, I am dealing with a similar way.
Because the sliding area is moving, the top of the slider is up to 0 from the top of the browser (the rest is negative [$ (' #bodycthead '). Offset (). Top]), when 0 indicates that it has returned to the top,
Continue to pull down when there should be no reaction, you can disable the default sliding, and pull up when the default sliding should be canceled, so the "Event.preventdefault ()" should be encapsulated into a function.
All you need to do is to determine if you want to swipe up or down and record a Y value when touching the screen (Scroll_start = E.changedtouches[0].clienty;), and a Y value will be generated when moving.
(E.changedtouches[0].clienty), two worth difference (E.changedtouches[0].clienty-scroll_start) If a positive value indicates a downward slide, and if it is negative, swipe up.
To add an event listener:
varscroll_start=0;//defining the starting point when slidingfunction handler () {//Disable default sliding function Event. Preventdefault ();} Document.addeventlistener ("Touchstart", Function (e) {Scroll_start= e.changedtouches[0].clienty;//set the point at which the start point is touch if($('#bodycthead'). Offset (). top==0){//If you touch the slider at the top, disable the default swipeDocument.addeventlistener ('Touchmove', Handler,false); }});d Ocument.addeventlistener ("Touchmove", Function (e) {$ ("title"). HTML (e.changedtouches[0].clienty-Scroll_start); if($('#bodycthead'). Offset (). top==0){//What you want to do is break the slide and disable the default swipe, temporarily not finding the way to breakDocument.addeventlistener ('Touchmove', Handler,false); } if((e.changedtouches[0].clienty-scroll_start) <0){//If you swipe up, restore the default swipeDocument.removeeventlistener ('Touchmove', Handler,false); }});
Solve the problem of pulling out the current webpage source or refresh under the top of the mobile browser