js控制进度条到达100%跳转界面一

进度条一般在手机上用到的比较广泛,刚好最近的项目也是一直在做手机站,这个特效是手机端的一个界面,现在我把改成pc端了,进度条的快慢速度和样式可自行调节,改动也是很方便的,不多说,看代码:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>js控制进度条到达100%跳转界面</title></head><style>    * {        margin: 0;        padding: 0;    }

    html, body {        font-family: arial, "microsoft yahei";        font-size: 14px;        background: #c2d7ac;    }

    .progress {        width: 300px;        height: 30px;        margin: auto;;        background: #70b4e5;        border-radius: 5px;        -webkit-box-shadow: inset -2px 0px 2px #3189dd, inset 0px -2px 2px #d4edf9, inset 2px 0px 2px #d4edf9, inset 0px 2px 2px #3189dd;        box-shadow: inset -2px 0px 2px #3189dd, inset 0px -2px 2px #d4edf9, inset 2px 0px 2px #d4edf9, inset 0px 2px 2px #3189dd;    }

    .progress_bar {        width: 0%;        height: 26px;        background: url("images/bar.jpg") repeat;        background-size: auto 100%;        border-radius: 5px;        position: relative;        left: 3px;        right: 3px;        top: 2px;    }

    p {        width: 300px;        text-align: center;        font-size: 14px;        color: #c20606;        position: absolute;        top: 98px;    }</style><body ><div style="height: 120px;"></div><div class="progress">    <div id=load>        <div class="progress_bar"></div>        <p>0</p>    </div></div><script type="text/javascript">    function setLOAD(v, el) {        var read = (document.all && document.getElementsByTagName);        if (read || document.readyState == "complete")            valueEl = el.children[1];        {            filterEl = el.children[0];            valueEl.innerText = v + "%";            filterEl.style.width = v + "%";

        }    }    function fakeProgress(v, el) {        if (v > 100)            location.href = "begin.html";        else {            setLOAD(v, el);            window.setTimeout("fakeProgress(" + (++v) + ", document.all[‘" + el.id + "‘])", 2000);        }    }</script>

</body></html>

效果:
时间: 2024-08-07 21:20:15

js控制进度条到达100%跳转界面一的相关文章

143行js顶部进度条最小插件-nanobar.js源码解析

网页顶部进度条插件的有四五种,基本原理就是动态地创建一个元素,然后通过设置它的width来实现动画效果,width增长到达指定位置时,将其去掉.来看看nanobar.js作者jacoborus是怎么做到的吧! /* http://nanobar.micronube.com/ || https://github.com/jacoborus/nanobar/ MIT LICENSE */ (function (root) { 'use strict' // container styles var

JS Loading 进度条实现思路

有时候访问网站,在加载的过程中经常会出现显示加载进度的进度条,或者类似的一个旋转的菊花图.如果留心的话不难发现,那些进度条出现的加载进度数字几乎每次都是那几个数字,30% -> 50% -> 80%,这样.这样会极大提高用户的体验,既能告知用户加载进度,让等待过程不再那么无聊,又能防止用户以为网站有问题而直接离开站点.但是这个进度条是怎么实现的呢? 一般在网络情况不好的情况下,加载的首页又比较大的时候就可以使用进度条或者一些有意思的动画.一般的实现方式刚开始时给整个页面加个蒙板层,将加载过程覆

js 实现进度条功能。

/** * 纯js进度条 * Created by kiner on 15/3/22. */ function progress(options){ this.w = (options && options.width)?parseFloat(options.width) : parseFloat(this.options.width); this.h = (options && options.height)?parseFloat(options.height) : pa

Js 百分比进度条

[构想] CSS3 + JS CSS3控制进度 利用CSS3中的 @keyframes JS实现百分比 根据CSS来调整,时间 [页面代码] CSS代码 body { background-color: #f5f7f9; color: #6c6c6c; font: 300 1em/1.5em; } .container { left: 50%; position: absolute; top: 40%; transform: translate(-50%, -50%); -webkit-tran

JS实现 进度条 不用控件 超级简单

http://www.jb51.net/article/61113.htm(转载出处) setTimeout和clearTimeou 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 <html> <head> <title>进度条</title> <style type

JS实现 进度条 不用控件

demo1 <html> <head> <title>进度条</title> <style type="text/css"> .container{ width:450px; border:1px solid #6C9C2C; height:25px; } #bar{ background:#95CA0D; float:left; height:100%; text-align:center; line-height:150%

C# 通过线程来控制进度条(转)--讲解多线程对界面的操作

// 通过创建委托解决传递参数问题 private void _btnRun_Click( object sender, System.EventArgs e ) { RunTaskDelegate runTask = new RunTaskDelegate( RunTask ); // 委托同步调用方式 runTask( Convert.ToInt16( _txtSecond.Value ) ); } //通过创建委托解决传递参数问题,通过委托的异步调用消除用户界面线程的阻塞问题 privat

【WInform】使用BackgroundWorker控制进度条显示进度

许多开发者看见一些软件有进度条显示进度,自己想弄,项目建好后发现并没有自己想象中的那么简单...看了网上很多教程后,写了一个小Demo供网友们参考~~,Demo的网址:http://pan.baidu.com/s/1dDIxHvz BackgroundWorker可以在代码中创建,也可以在工具箱中拖,但如果要使用,必须将其的WorkerReportsProgress属性设置为True! 这个Demo是一个复制文件的,为了效果更明显,建议复制的文件多一点,方便进度条显示. 界面如下: 下面是全部代

带进度条的自动跳转页面代码

?<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>正在进入西农大网站</title></head><body><form name=loading> <p align=center> <font color="#0066