6

On Chrome Mobile, Google introduced a tab navigation with the swipe left/right events.

But i have a webapp, and i implement a swipe left event to open my navigation menu (like facebook or spotify)

The problem is, if user start his swipe on the first left pixel (left:0), the browser start the navigation mode, and do not execute my opening menu function.

Is there a way, to disable or stop the navigation mode on Chrome ?

I already tried with .preventDefault, and stopPropagation function, but not working :(

Thanks for your help

JuSchz
  • 1,200
  • 2
  • 15
  • 30
  • Another thought - maybe you should change your UI instead? It's going to be frustrating for users of your mobile site if they can't change tabs in their browser any more. – Fabian Tamp Nov 20 '12 at 22:43
  • Switching tabs can be done without having to swipe, and IMO this gesture is actually really annoying for developers. unfortunately there really is no solution other than to change the UI... – gengkev Nov 22 '12 at 00:40
  • I am running into this as well. I noticed that Google Sheets somehow disables this, so it must be possible. – Breck May 10 '19 at 06:21

2 Answers2

-1

Could you try using a combination of:

  • intercepting the browser Back function using window.onbeforeunload, as per this example, and
  • disabling navigation using the technique illustrated in this example?
Fabian Tamp
  • 4,416
  • 2
  • 26
  • 42
-3

This behaviour is built into the java source of chrome (probably), which is why I think it won't be possible to disable this behaviour with Javascript alone. Maybe you can distribute you app with phonegap, if this behaviour is necessary.

Joseph Adams
  • 972
  • 1
  • 6
  • 19
  • I already have a native version. But this webapp is a light version of the app, for user with no the app not installed. – JuSchz Nov 16 '12 at 12:04