首頁  >  文章  >  web前端  >  JS 實現有進度條的頁面跳躍特效

JS 實現有進度條的頁面跳躍特效

高洛峰
高洛峰原創
2016-12-16 16:48:112107瀏覽

當進度條到100%進打開指定的網站,通常用於一些404頁面等等方面。

<html><head><script language="javascript">
  function setSB(v, el) {    var ie5 = (document.all  &&  document.getElementsByTagName);    if (ie5 || document.readyState == "complete")     {
      filterEl = el.children[0];
      valueEl = el.children[1];
      filterEl.style.width = v + "%";
      valueEl.innerText = v + "%";
    }
  }  function fakeProgress(v, el) {    if (v > 100)      location.href = "http://www.newxing.com/";    else     {
      setSB(v, el);      window.setTimeout("fakeProgress(" + (++v) + ", document.all[&#39;" + el.id + "&#39;])", 20);
    }
  }</SCRIPT></head><body onload="fakeProgress(0, sb)" topmargin=180 bgcolor=#CCCCCC><center><p align=center style="font-szie:9pt; line-height: 100%">正在进入新兴网络,请稍侯……</p><span id=sb style="width: 500px"><div style="filter: Alpha(Opacity=0, FinishOpacity=60, style=1, StartX=0, StartY=0, FinishX=100, FinishY=0); width: 0%; height: 12px; position: absolute; background: #9999ff"></div><div style="font-size: 12px; width: 100%; color: #ff3333; font-family: arial; text-align: center"></DIV></span>
 </center>
 </body></html>


更多JS 實現帶進度條的頁面跳轉特效相關文章請關注PHP中文網!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn