繁体   English   中英

JS在Firefox中导致无限循环

[英]JS causing infinite loop in Firefox

我页面上的脚本正在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.
});

$("#mr-container").height(new_height);

这解决了问题。

暂无
暂无

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

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