在JavaScript中停用Chrome浏览器中的导航滑动功能 [英] Disable navigation swipe on Chrome browser in javascript
问题描述
但是我有一个web应用程序,并且我实现了一个滑动左侧事件来打开我的导航菜单(如Facebook或Spotify)
问题是,如果用户在第一个左侧像素(左侧:0)上开始滑动,浏览器将启动导航模式,并且不要执行我的打开菜单功能。
有没有办法在Chrome上禁用或停止导航模式?
我已经尝试过使用 .preventDefault
和 stopPropagation
函数,但不工作:(
感谢您的帮助
您可以尝试使用以下组合:
- 拦截浏览器
返回使用
的函数window.onbeforeunload
,根据这个例子,和
<升我使用此示例中所示的技术禁用导航?
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
Could you try using a combination of:
- intercepting the browser
Back
function usingwindow.onbeforeunload
, as per this example, and - disabling navigation using the technique illustrated in this example?
这篇关于在JavaScript中停用Chrome浏览器中的导航滑动功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!