로드하는 데 20-30 초가 걸리는 웹 페이지가 있습니다. 페이지로드가 끝나면 닫히는 팝업 ("Please wait ...")을 열 수 있습니까? 나는 다음을 시도했지만 효과가 없다. 페이지가 예상대로로드되지만 팝업은 표시되지 않습니다. 내 개발 플랫폼으로 Firefox를 사용하고 있습니다. 조건을 역전 (#container hidden/none 및 closePopup()이 visible/block으로 재설정 됨)하면 페이지가 로딩 될 때 팝업이 나타납니다. 두 번째 질문으로, 비록 이것이 작동하더라도, 브라우저에 크게 의존 할 것인가? 감사!페이지로드 중에 CSS 팝업을 열고 페이지로드가 완료되면 닫는 방법
<html><head><style>
#container{
width : 100%;
height : 100%;
top : 0;
position : absolute;
visibility : visible;
display: block;
background-color : rgba(22,22,22,0.5);
}
#popup{
position : relative;
margin: 0 auto;
top: 35%;
width : 300px;
padding : 10px;
border : 1px solid black;
background : yellow;
box-shadow: 5px 5px 5px #252525;
}
</style>
<script language="javascript">
function closePopup(){
document.getElementById('container').style.visibility = "hidden";
document.getElementById('container').style.display = "none";
}
</script></head><body onload="closePopup();">
<div id="container"><div id="popup">Please Wait...</div></div>
20 seconds worth of stuff happens here.
</body></html>
W3에 따르면 지연 속성은