Home > Web Front-end > JS Tutorial > body text

JS implements page jump effects with progress bar

高洛峰
Release: 2016-12-16 16:48:11
Original
2131 people have browsed it

当进度条到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>
Copy after login


更多JS 实现带进度条的页面跳转特效相关文章请关注PHP中文网!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!