javascript - Prevent accidental scrolling with swipe in jQuery Mobile -


I am using jQuery Mobile when the user can accidentally scroll the page while swiping on the left or right, So again and again the "rant" page is closed above the window. I want to suppress page scrolling during the left or right swipe event. I have tried:

  $ ('# foo'). ('Swipeleft swiperight', function (ev) {$ .event.special.swipe.scrollSupressionThreshold = 100; ...});   

But this does not stop the behavior. I tried to add status: fixed during a swipe event for both HTML and Body Dome. Neither works because they change the flow of the page. How should I face this problem? Thank you.

You can use debugging functions like I took

 // Minified Only 160 bytes! Function debans (A, B, C) {var d; Return function () {var e = this, f = arguments; Clear timeout (d), d = set timeout (function () {d = null, c || a.apply (e, f)}, b), c and amp; D & amp; a. Apely (E, F)}} var myDebouncedFn = debugs (function () {// you all taxing stuff}, 250); Window.addEventListener ('Swipe', myDebouncedFn);  

But you should read better , because it's built in:

  $. Event.special.swipe.scrollSupressionThreshold (Default: 10px) A More than this horizontal displacement, and we will suppress the scrolling. $ .event.special.swipe.durationThreshold (default: 1000ms) one ???? More than this, and do not swipe it $ .event.special.swipe.horizontalDistanceThreshold (default: 30px) a ???? Swipe horizontal displacement should be greater than this. $ .event.special.swipe.verticalDistanceThreshold (default: 75px) a ???? Swipe vertical displacement should be less than this.    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -