솔루션을 잠금 .resize :
http://noteslog.com/post/how-to-fix-the-resize-event-in-ie/
개발 문제 :
내가 IE7 호환성을 데 jQuery 문제. 본질적으로 일어날 일은 resize 이벤트가 두 div가 표시되지 않도록 지시하고 다른 div가 표시되도록 변경하는 것입니다. 그런 다음 setTimeout이 발생하면 div가 다시 변경되고 표시된 다른 div는 표시되지 않습니다. 그런 다음 페이지를 다시로드합니다. 이것은 IE8, IE9, Mozilla, Chrome, Safari에서 잘 작동합니다. 그래서 이것은 IE7과 관련이 있어야합니다. 어떤 제안과 아이디어? 나는 항상 감사합니다.
<script type="text/javascript">
$(document).ready(function(){
$(window).resize(function() {
$('#res_mainContainer').css({"display":"none"});
for (var h = 1; h < 100; h++)
{
$('#CarLot' + h).css({"visibility":"hidden"});
}
$('#loading').css({"display":"block"});
var constantResize = jQuery(window).width() + 'x' + jQuery(window).height();
$("#WINDOWS_RESOLUTION").text(constantResize);
setTimeout(function() {
$('#res_mainContainer').css({"display":"block"});
for (var h = 1; h < 100; h++)
{
$('#CarLot' + h).css({"visibility":"visible"});
}
$('#loading').css({"display":"none"});
location.reload()
}, 2000);
});
});
</script>
스로틀 때 사용 된 오래된 자바 스크립트 :
<script type="text/javascript">
var timeoutId;
function throttleResize(fn) {
window.onresize = function() {
window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(function() {fn.call();}, 1000);
document.getElementById("loading").className = "loading-visible";
document.getElementById('res_mainContainer').style.visibility = 'hidden';
for (var h = 1; h < 40; h++)
{
document.getElementById('Carlot' + h).style.visibility = 'hidden';
}
};
}
function doSomething() {
window.location.reload(true);
document.getElementById("loading").className = "loading-invisible";
document.getElementById('res_mainContainer').style.visibility = 'visible';
for (var h = 1; h < 40; h++)
{
document.getElementById('CarLot' + h).style.visibility = 'visible';
}
}
throttleResize(doSomething);
</script>
그래서 정확히 IE7에서 어떻게됩니까? "잠그고"한다는 것은 무엇을 의미합니까? – Pointy
문제 : resize 이벤트가 발생할 때로드 할 것으로 생각되는 화면이 실제로 처음에로드됩니다. setTimeout이 실행되면 함수에서 공개 된 div를 표시하지 않고 화면을 다시로드 화면으로 다시 이동합니다. – user763349