简体   繁体   English

如何在Windows Phone 8 PhoneGap中包含swype?

[英]how to include swype in windows phone 8 phonegap?

I am developing a phonegap application in windows phone 8, android, bb10, iphone. 我正在Windows Phone 8,Android,BB10,iPhone中开发phonegap应用程序。

i use quo.js for swyping in all platforms but it does not applied in wp8. 我在所有平台上使用quo.js进行刷卡,但不适用于wp8。

if you have any solution, please help me. 如果您有任何解决方案,请帮助我。

 $$('#wrapper').swipeLeft(function() 
 {
     //mycode
 });

See there link (official Windows Phone developer blog post). 请参阅此处的链接(Windows Phone开发人员官方博客文章)。

The pointer API uses a standard “down, move, up” event model. 指针API使用标准的“向下,向上,向上”事件模型。 Therefore, it's simple to hook up listeners for existing event handlers to pointer events. 因此,很容易为现有事件处理程序将侦听器连接到指针事件。

Before 之前

    this.element.addEventListener("touchstart", eventHandlerName, false); 
    this.element.addEventListener("touchmove", eventHandlerName, false);
    this.element.addEventListener("touchend", eventHandlerName, false);

After

    if (window.navigator.msPointerEnabled) {
      this.element.addEventListener("MSPointerDown", eventHandlerName, false);
      this.element.addEventListener("MSPointerMove", eventHandlerName, false);
      this.element.addEventListener("MSPointerUp", eventHandlerName, false);
    }
    this.element.addEventListener("touchstart", eventHandlerName, false);
    this.element.addEventListener("touchmove", eventHandlerName, false);
    this.element.addEventListener("touchend", eventHandlerName, false);

Turning off default touch behavior 关闭默认的触摸行为

The pointer event model in Internet Explorer 10 requires you to explicitly indicate which areas of the page will have custom gesture handling (using the code you just added), and which will use default gesture handling (pan the page). Internet Explorer 10中的指针事件模型要求您明确指示页面的哪些区域将具有自定义手势处理(使用刚添加的代码),以及哪些区域将使用默认手势处理(平移页面)。 You can do this by adding markup on elements that should opt out of default gesture handling using the -ms-touch-action property. 您可以通过使用-ms-touch-action属性在应选择退出默认手势处理的元素上添加标记来做到这一点。 For example: 例如:

Before 之前

<div id="slider" style="overflow: hidden;">

After

<div id="slider" style="overflow: hidden; -ms-touch-action: none;">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM