Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/368.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JS在Firefox中引发无限循环_Javascript_Jquery_Apache Flex_Firefox - Fatal编程技术网

Javascript JS在Firefox中引发无限循环

Javascript JS在Firefox中引发无限循环,javascript,jquery,apache-flex,firefox,Javascript,Jquery,Apache Flex,Firefox,我页面上的一个脚本在FireFox中引起了无限循环 下面是Javascript: function expandMothersRings(new_height) { window.scrollTo(0, 0); $('#mr-container').animate({ height: new_height }, 100, function() { // Animation complete. }); } 这是通过Flex对象的Ex

我页面上的一个脚本在FireFox中引起了无限循环

下面是Javascript:

function expandMothersRings(new_height)
{
    window.scrollTo(0, 0);
    $('#mr-container').animate({
        height: new_height
    }, 100, function() {
        // Animation complete.
    });
}
这是通过Flex对象的
ExternalInterface
调用的:

var tiles_height:Number = 175+Math.ceil(MothersRingData.getInstance().styleArrayCollection.length/4)*175;
ExternalInterface.call("expandMothersRings", tiles_height + 300);
IE或Chrome没有问题。但是由于某种原因,
expandMothersRings
函数在FF中无限循环

flex对象不希望Javascript返回任何值。另外,如果我将JS函数更改为:

function expandMothersRings(new_height)
{
    alert(new_height);
}
然后它只执行一次。因此函数中的某些内容导致它在Firefox中循环

我不知道是什么

这是我换的

$('#mr-container').animate({
    height: new_height
}, 100, function() {
    // Animation complete.
});


这就解决了问题。

页面一直试图在FF中为我重新加载。。这可能是导致您出现问题的原因吗?您在“动画完成”方法中有任何代码吗?@Shadow Wizard,没有,我想我可能会添加一些代码,所以在调试时我会像那样对其进行注释,但不需要这样做。事实证明,我也不需要它来制作动画,正如你所看到的,我把它设置为100毫秒。我把它改成了完全没有动画,只是设置了它,这就解决了这个问题。@John,这太奇怪了。。以前使用过jQuery动画,没有任何问题。@Shadow Wizard,是的,我确信这可能是与其他未知因素的结合。
$("#mr-container").height(new_height);