简体   繁体   English

JQtouch useFastTouch在带Phonegap的iPhone上不起作用

[英]JQtouch useFastTouch dont work on iPhone with Phonegap

Or does it? 还是呢? JQtouch has, as default, useFastTouch set as true. 默认情况下,JQtouch将useFastTouch设置为true。 But my app still has the 300ms delay, actauly its up to one secound. 但是我的应用程序仍然有300毫秒的延迟,实际上是它的一秒。 Then i read that i should use ".tap event" but how do i attache the tap event to all my a-tags ? 然后我读到我应该使用“ .tap event”,但是我该如何将tap事件附加到我的所有a标签上? i tryed alot, but then i loose the animation between pages or the delay is still present. 我尝试了很多,但是随后我在页面之间松动了动画,或者仍然存在延迟。

I found this thread, wich is 8 month old... Still no solution?: https://github.com/senchalabs/jQTouch/issues/360 我发现这个线程,已经有8个月了...仍然没有解决方案?: https : //github.com/senchalabs/jQTouch/issues/360

When i try to use this solution, (scroll down to testing the webapp...) but my app crasches: http://www.dconnell.co.uk/blog/index.php/2011/08/01/developing-an-iphone-app-using-html-css-javascript-and-phonegap-from-concept-to-app-store/ 当我尝试使用此解决方案时,(向下滚动以测试webapp ...),但我的应用却步履蹒跚: http ://www.dconnell.co.uk/blog/index.php/2011/08/01/developing- 一个iphone应用程序使用html-css-javascript-and-phonegap从概念到应用程序商店/

I sort of made a solution. 我有点解决了。 First of all i had to remove all animations from JQtouch. 首先,我必须从JQtouch中删除所有动画。 Which really speeded things up... To get rid of ghost clicks i made a style which disable the pointer 真正加快了速度...为了摆脱鬼点击,我制作了一种禁用指针的样式

<style type="text/css">
        .pointer-events-none {
            pointer-events: none;
        }
    </style>

Then in my Functions i placed this code: 然后在我的函数中放置以下代码:

$('a[href=#some_class], a[href=#some_class]').not('a.on').bind('touchstart', function(e) {

               var pageToGoTo = $(this).attr('href');
                   jQT.goTo(pageToGoTo, 'slide');

                   $('.scroll').addClass('pointer-events-none');

                   setTimeout(function(){
                      $('.scroll').removeClass('pointer-events-none');
                   }, 1500);

  });

It works, but if I set the timeout lower 1500 the app crashes... 它可以正常工作,但是如果我将超时时间设置为1500以下,则应用崩溃

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

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