禁用向右滑动到Windows Phone上的上一页 [英] Disabling swipe right to previous page on Windows Phone

查看:83
本文介绍了禁用向右滑动到Windows Phone上的上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 http://wipetouch.codeplex.com/ 来实现滑动Meteor应用程序在Iron Router中的模板之间切换。

I'm trying to use http://wipetouch.codeplex.com/ to implement swiping on a Meteor app to shift between templates in Iron Router.

它在iOS和Android上运行得非常漂亮,但在Windows Phone上,操作系统的本机滑动手势(在浏览器中向右滑动)历史记录中的一页干扰用户的滑动操作。

It works beautifully on iOS and Android but on Windows Phone, the OS' native swipe gesture (swiping right in the browser moves one page back in history) interferes with the user's swiping action.

有什么方法可以禁用此功能吗?

Is there any way I can disable this?

还有哪些其他平台具有类似的功能,可以阻止用户有效地在网络应用程序中滑动?

Also which other platforms have similar functionality which would prevent the user from swiping in the web app effectively?

例如,这个应用程序也使用相同的库来实现滑动手势。

As an example, this app also uses the same library to implement swipe gestures.

注意:在body标签上使用touch-action:none不起作用。

Note: Using touch-action: none on the body tag does not work.

推荐答案

我在一个小网站上遇到了同样的问题应用程序:它是一个临时游戏,其中玩家必须在可刮擦区域上滑动手指以发现他赢得了什么。

I encountered the same problem on a little web application : it which was a scratch game, where the player had to swipe the finger all over the "scratchable" zone to discover what he had won.

该游戏应该在Windows 8.1平板电脑上运行,其上有IE10 。

The game was supposed to run on Windows 8.1 tablets, with IE10 on it.

我们在这个片段中输入了css:

We put in the css this snippet :

*{
    touch-action: none;
}

结果是完全停用应用上的任何触摸事件(包括滑动向后/向前)。

The result is to completely deactivate any touch events on the app (including the swipe backward / forward).

但是我们必须仅在暂存区重新激活触摸事件,以允许玩家玩:)

But we had to reactivate the touch event only on the scratch zone, to allow the player to play :)

为此我们必须添加:

#playzone{
    touch-action: chained;
}

该应用程序仍能正常运行,无论是在平板电脑上的IE10上还是在Windows Phone上8.1。

The app still works perfectly, both on IE10 on tablets but also on Windows Phone 8.1.

(请原谅我的英文,这不是我的母语)

(please forgive my English, it's not my mother tongue)

编辑:测试更多在IE上,似乎在html元素上添加 touch-action:none; 就足以实现OP想要的。

EDIT : After having tested more on IE, it seems that adding the touch-action:none; on the html element is enough to achieve what the OP wanted.

这篇关于禁用向右滑动到Windows Phone上的上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆