<html>
<head>
<title>梅花雪的页面加载</title>
  <script language=javascript><!--
  document.write('<div id=loadDiv style="padding-top: 50; padding-left: 50">'+
                 '页面正在载入,请等待<span id="loading"></span></div>');
  var setInterval1 = setInterval("loading.innerText += '.'", 300);
  var setInterval2 = setInterval("loading.innerText = ''", 15000);
  function window.onload()
  {
     hiddenDiv.style.display=""; //显示页面内容
     loadDiv.removeNode(true);
     clearInterval(setInterval1);
     clearInterval(setInterval2);
  }
  // --></script>
</head><body>
<div id=hiddenDiv style="display: none">
<img src=http://www.csdn.net/images/homeimage/csdn.gif>
  <!-- 将你的网页所有内容都放在这个div之内即可 --></div>
</body>
</html>

解决方案 »

  1.   

    http://fason.nease.net/code/js/loading.htm阿信的loading,你参考一下
      

  2.   

    给你讲讲原理:
    load页面上的效果自己处理,然后加入一个隐藏的iframe,然后再load页面onload的时候,location=iframe.location
    that's all
      

  3.   

    1.将下面的代码复制到 <head> 内
    <style>
    <!--
    #bar, #barbackground{
    position:absolute;
    left:0;
    top:0;
    background-color:blue;
    }#barbackground{
    background-color:black;
    }-->
    </style><script language="JavaScript1.2">/*
    Dynamic Progress Bar- By Dynamicdrive.com
    For full source, Terms of service, and 100s DTHML scripts
    Visit http://www.dynamicdrive.com
    *///1) Set the duration for the progress bar to complete loading (in seconds)
    var duration=5//2) Set post action to carry out inside function below:
    function postaction(){
    //Example action could be to navigate to a URL, like following:
    //window.location="http://www.dynamicdrive.com"
    }
    ///Done Editing/////////////
    var clipright=0
    var widthIE=0
    var widthNS=0function initializebar(){
    if (document.all){
    baranchor.style.visibility="visible"
    widthIE=bar.style.pixelWidth
    startIE=setInterval("increaseIE()",50)
    }
    if (document.layers){
    widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
    document.baranchorNS.document.barNS.clip.right=0
    document.baranchorNS.visibility="show"startNS=setInterval("increaseNS()",50)
    }
    }function increaseIE(){
    bar.style.clip="rect(0 "+clipright+" auto 0)"
    window.status="Loading..."
    if (clipright<widthIE)
    clipright=clipright+(widthIE/(duration*20))
    else{
    window.status=''
    clearInterval(startIE)
    postaction()
    }
    }function increaseNS(){
    if (clipright<202){
    window.status="Loading..."
    document.baranchorNS.document.barNS.clip.right=clipright
    clipright=clipright+(widthNS/(duration*20))
    }
    else{
    window.status=''
    clearInterval(startNS)
    postaction()
    }
    }
    window.onload=initializebar
    </script>2.将下面的代码复制到 <body> 内
    <script language="JavaScript1.2">
    if (document.all){
    document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
    document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
    document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
    document.write('</div>')
    }</script>
    <ilayer name="baranchorNS" visibility="hide" width=200 height=20>
    <layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
    <layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
    </ilayer>