且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery动画错误=尝试在已清除的范围内运行编译脚本

更新时间:2022-02-26 08:39:13

这似乎与FF4有关.参见.正如另一个线程所说,尝试清除缓存.

This seems to be an issue with FF4. See this and this. As the other thread says try clearing the cache.

尝试此代码并检查是否仍然出现错误-演示

Try this code and check if you still get the error - demo

$(function() {
    animateFinger();
});

$("#abc").mousedown(function() {
    $("#finger").toggle("display");
});

function animateFinger() {
    $("#finger").animate({
        marginLeft: 130
    }, 1000).animate({
        marginLeft: 0
    }, 1000, animateFinger);
}


如果这不起作用,请尝试使用 setInterval 并每2000年调用一次该方法毫秒-演示


If that doesn't work try using setInterval and calling the method every 2000 milliseconds - demo

$(function() {
    animateFinger();
    setInterval(animateFinger, 2000);
    // You can also try function(){setTimeout(animateFinger, 0)} as a callback method instead of setInterval
});

$("#abc").mousedown(function() {
    $("#finger").toggle("display");
});

function animateFinger() {
    $("#finger").animate({
        marginLeft: 130
    }, 1000).animate({
        marginLeft: 0
    }, 1000);
}

在您的指点业务中一切顺利. ;)

All the best in your finger pointing business. ;)