On a Windows phone, in IE users can go back and forward by swiping on the screen if the swipe is coming from the edge. This OS level functionality is hampering my webpage's UX.
Is there any js or css which can disable that? Some hack would also do.
A snapshot from windowsphone's website:
Here is the link to the reference page: http://www.windowsphone.com/en-in/how-to/wp8/basics/gestures-swipe-pan-and-stretch
Please note that I still need touchaction enabled for horizontal scrolling.
Select the Settings menu from the options list. Scroll down to the Continue browser option, and tap on it. Disable the toggle button against the Swipe navigation option to turn OFF.
Disable Google Chromes Gestures You can disable chromes gestures by going to System Preference > Mouse OR Trackpad > More Gestures > and uncheck Swipe between pages.
In System Preferences go to Trackpad > More Gestures. Then disable "Swipe between pages".
The div to swip is id="swiper". JavaScript to Swip(It Works): $(function() { //Enable swiping... $("#swiper").
You Should Try this solution in two way :
1) CSS only fix for Chrome/Firefox
html, body { overscroll-behavior-x: none; }
2) JavaScript fix for Safari
if (window.safari) { history.pushState(null, null, location.href); window.onpopstate = function(event) { history.go(1); }; }
Over time, Safari will implement overscroll-behavior-x and we'll be able to remove the JS hack
Possible duplicate of iOS 7 - is there a way to disable the swipe back and forward functionality in Safari?
Copy and paste this JavaScript:
var xPos = null; var yPos = null; window.addEventListener( "touchmove", function ( event ) { var touch = event.originalEvent.touches[ 0 ]; oldX = xPos; oldY = yPos; xPos = touch.pageX; yPos = touch.pageY; if ( oldX == null && oldY == null ) { return false; } else { if ( Math.abs( oldX-xPos ) > Math.abs( oldY-yPos ) ) { event.preventDefault(); return false; } } } );
If you want it minified, copy and paste this:
var xPos=null;var yPos=null;window.addEventListener("touchmove",function(event){var touch=event.originalEvent.touches[0];oldX=xPos;oldY=yPos;xPos=touch.pageX;yPos=touch.pageY;if(oldX==null && oldY==null){return false;}else{if(Math.abs(oldX-xPos)>Math.abs(oldY-yPos)){event.preventDefault();return false;}}});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With