ie 7 window resize
1464 단어 window
ie 6, ie 7 은 window resize 에 여러 번 나타 납 니 다.
$(function(){
$(window).resize(function(){
//
alert(1);
//IE 6 , IE7
height = $(window).height();
eventId = setTimeout(function(){
newHeight = $(window).height();
if(newHeight == height){
alert(1);
clearTimeout(eventId);
}
},1000)
});
})
//
//date 2014 12 20
tempHeight = 0 ;
tempWidth = 0 ;
timeoutId = 0 ;
var clearId = function(max){
for(var i = 0 ; i <= max ; i++){
clearTimeout(i);
}
}
$(window).resize(function(){
timeoutId = setTimeout(function(){
alert(1);
alert("time out id is "+timeoutId);
clearId(timeoutId);
},500);
})
위의 방법 은 내 가 스스로 해결 하 는 것 이다. 아래 는 인터넷 에 더욱 넓 은 방법 을 제공 하고 효율 이 좀 더 높 을 것 이다.
$(window).resize($.debounce(1000, function(){
alert(1);
}));
http://stackoverflow.com/questions/1500312/dom-onresize-event 이 연결 참조
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
TIL - Window global object자바스크립트가 돌아가는 플랫폼은 호스트(host) 라고 불립니다. 호스트는 브라우저, 웹서버, 심지어는 커피 머신이 될 수도 있습니다. 각 플랫폼은 해당 플랫폼에 특정되는 기능을 제공하는데, 자바스크립트 명세서에선 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.