로드하는 데 몇 초가 걸리는 페이지의 div에 두 개의 큰 이미지 파일이 있습니다. "loading gif"가 나타나는 동안 어떻게 로딩 콘텐츠를 숨기고 완전히로드 된 후에 콘텐츠를 보이게 할 수 있습니까?콘텐츠 숨기기로드 중 GIF
자바 스크립트에 대해 아무 것도 모르지만이 코드를 사용해 보았습니다. 그것은 내가하고 싶었던 것의 절반을했습니다. "로딩 GIF"가 작동했지만 문제는 콘텐츠가 로딩 될 때 볼 수 있다는 것이 었습니다.
http://aaron-graham.com/test2.html
<div id="loading" style="position:absolute; width:95%; text-align:center; top:300px;">
<img src="img/parallax/ajax-loader.gif" border=0>
</div>
<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>
어떤 도움을 크게 감상 할 수있다! 와
는 – MikeM
동의 내 눈을 점화 , 때로는 클라이언트 측 코드가 싫어. – Ben