setTimeout的不叫Android的WebKit的 [英] setTimeout not called in android webkit

查看:103
本文介绍了setTimeout的不叫Android的WebKit的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid手机(2.1),我看到一个奇怪的现象与setTimeout的保持pssed在触摸屏上一会儿手指$ P $的时候。

这很简单code其实工作正常(1调用每秒),直到我滚动了一段时间窗口(2-3秒就足够了),当它不再是所谓的

  $(文件)。就绪(函数(){
    垃圾邮件();
});

功能垃圾邮件(){
    的console.log(CIA)
    的setTimeout(垃圾邮件,1000);
}
 

解决方案

我有同样的问题。

解决的办法是对我定义调用函数作为变量,比IST传递作为参数传递给setTimeout的。

试试这个:

 变种垃圾邮件=功能(){
   的console.log(CIA)
   的setTimeout(垃圾邮件,1000);
}

$(文件)。就绪(函数(){
   垃圾邮件();
});
 

On my android phone (2.1) I'm seeing a strange behavior with setTimeout when keeping a finger pressed on the touchscreen for a while.

This very simple code in fact works fine (1 call each second), until I scroll for a while the window (2-3 seconds are sufficient), when it stops being called

$(document).ready(function(){
    spam();
});

function spam(){
    console.log("cia")
    setTimeout(spam, 1000);
}

解决方案

I has the same Problem.

The solution was for me to define the called function as a variable, than passing ist as parameter to the setTimeout.

Try this:

var spam = function(){
   console.log("cia")
   setTimeout(spam, 1000);
}

$(document).ready(function(){
   spam();
});

这篇关于setTimeout的不叫Android的WebKit的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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