2

具体来说,我在 Android 平板电脑上看到了这个问题,但我被告知它适用于所有移动设备——iPhone、Nexus 平板电脑等。

但我有更改事件不触发的常见问题。这是分配了点击事件的功能代码:

function do_this(with_this_data)
{
    var that = this;


    this.with_this_data = with_this_data;
    this.period = 900;
    this.updateHours();

    $('#date').change(function() {
        that.updateHours();
    });

    $('#time_hour').change(function() {
        that.updateMinutes();
    });

    // extra irrelevant data trimmed out
}

现在......应该工作的一个修复是将这些 .change() 语句移动到 $(document).ready 块中 - 但问题是,如果我这样做,那么我会得到各种未定义的变量问题和东西。 ...所有“更新”函数都在所述 $(document).ready 块内,并由“FutureStuff.prototype.updateMinutes”等名称定义。

我有什么选择???

4

1 回答 1

1

Mifeet, again, I appreciate your feedback; I know you weren't able to fully get me up and running, but I'm still thankful.

But anyway, I solved the issue...it meant that basically I had to rewrite a new version of the JS code and stick it in an "if this chap is using a mobile browser" block. So yeah, one huge block of code for desktop users, another for mobile...but it works. :) And it was a pain in the hiney.

于 2013-06-06T20:33:34.410 回答