[英]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.