2012-08-06 1 views
0

문제는 마지막부터 5 번째 줄에 jquery 기능을 사용하는 것입니다.이 줄을 제거하면 정상적으로 작동하지만 그렇지 않으면 브라우저 {firefox 특히}가 작동하지 않습니다. 사용자가 새 업데이트를 인식하게합니다 ... 애니메이션 기능이 브라우저를 손상시키는 이유는 무엇이든지 말해 줄 수 있습니까 ???jquery의 애니메이션 기능이 브라우저를 크래킹합니다.

function doAnimation() { 

    var newUpdate = newUpdates.updates[updateIterator] != null ? newUpdates.updates[updateIterator] : null; 
    var update = ""; 

    while (newUpdate != null) { 

     if (updateIterator == 0) { 
      $(".nodata").hide(); 
     } 

     lastupdateTime = newUpdate.lastUpdate; 



     update += "<div class='live-updates-data'><img width='48px' height='48px' class='" + newUpdate.clientId + "' src='company_logo/thumb/" + newUpdate.img + "' align='logo' onerror='showDefaultimage(this);' /><h2><span>" + newUpdate.title + "</span></h2>&nbsp;&nbsp;&nbsp; <a style='font-family:Arial, Helvetica, sans-serif' class='" + newUpdate.clientId + " mp'> &nbsp;&nbsp;|&nbsp; Join Chat &nbsp;</a><p>" + newUpdate.updateMessage + "</p></div>"; 

     updateIterator++; 
     newUpdate = newUpdates.updates[updateIterator] != null ? newUpdates.updates[updateIterator] : null; 




    } // end of while 
    // after finishing the while loop 
    if (update != "") { 
     $("#shoutBox").prepend(update); 
     $("#shoutBox div:first-child").animate({ 
      "height": "toggle" 
     }, "slow", "linear"); 
    } 
    oTimeout = setTimeout(getShouts, timoutSpeed); //Again start the timout function to ge 
    updateIterator = 0; 
    return false; 
} 
+0

easing을 사용하고 있습니까? –

+0

예 저는이 애니메이션 기능이 전에 "linear"였습니다. $ ("# shoutBox div : first-child"). animate ({ "height": "toggle"}, 1, "linear",() 함수 \t \t \t \t { \t $ ("#의 shoutBox의 사업부 : 첫 아이"). "토글"}, "선형" "느린"함수() \t \t ({ "높이"애니메이션 \t \t \t { \t \t \t \t \t \t // updateIterator ++;\t \t \t \t // setTimeout (doAnimation, 5000); \t \t \t \t \t}); \t \t \t \t}); \t \t \t \t \t} 다음 내가 로 변경 \t $ ("#의 shoutBox의 사업부 : 첫 아이를"() { "높이"애니메이션 :. "토글"}, "느린을", "선형"); –

+0

오류가 발생하면서 브라우저가 오류를 발생 시키거나 jquery.js 파일에서 일부 스크립트가 작동을 멈추거나 응답하지 않음 –

답변

0

이렇게하면 jquery 애니메이션 대기열에 추가되는 $(".nodata").hide();이 계속해서 발생합니다. 다음 용도로 사용 ...

if (updateIterator === 0 && !$(".nodata").is(":hidden")) { 
      $(".nodata").hide(); 
} 
+0

여전히 오류가 발생합니다 ( –

+0

) 여기서 while 루프를 사용하는 이유는 무엇입니까? –

+0

while while while while loop 문제가 아니 었습니다. 그것은 다른 것이 었습니다 : P –

관련 문제