2012-05-09 3 views
0

ie를 사용하고 브라우저 창 너비가 1400 미만인 경우 애니메이션을 변경하려고합니다. 내 코드 (애니메이션 변경)가 작동하지 않습니다. 창 너비 변경. 누구든지 도와 줄 수 있습니까?윈도우의 너비와 애니메이션이 바뀌고 있습니다.

$(document).ready(function() { 



    function checkWindow() { 


       if ($.browser.msie) { 

       if ($(window).width() >= 1400) {  

       $("#box1").everyTime(2, function(){       
         $("#box1").animate({top:"-20px"}, 3000).animate({top:"-10px"}, 3000); 
         }); 
       $("#box2").everyTime(10, function(){       
         $("#box2").animate({top:"-100px"}, 2500).animate({top:"-90px"}, 2500);  
         });   

       console.log("width over 1400"); 

       } else { 

       $("#box1").everyTime(2, function(){       
         $("#box1").animate({top:"-200px"}, 3000).animate({top:"-100px"}, 3000); 
         }); 
       $("#box2").everyTime(10, function(){       
         $("#box2").animate({top:"-200px"}, 2500).animate({top:"-900px"}, 2500);  
         });  

       console.log("width under 1200");  

       } 

       } 

    } 

var resizeTimer; 


$(window).resize(function() { 
    clearTimeout(resizeTimer); 
    resizeTimer = setTimeout(checkWindow, 100); 
}); 





}); 

답변

0

당신은 아마도 어딘가에서 $ .stopTime로 전화가 필요하십니까 : 여기

코드인가? 그렇지 않으면 $ .everyTime 호출은 윈도우 크기가 변경된 후에도 지속됩니다.

관련 문제