标签:百分比 center 有一个 star 停止 结束 win mil 执行
<link rel="stylesheet" type="text/css" href="css/NProgress.css">
<script src="js/NProgress.js" type="text/javascript"></script><br>//还有jquery要引入进来
<script>
$(function() {
NProgress.start();
$(window).load(function() {
NProgress.done();
});
</script>
<script type="text" id="myId"><br> <div class="splash card"><br> <p class="lead" style="text-align:center">不要回来,马上走开...</p>
<div class="progress">
<div class="mybar" role="bar">
</div>
</div>
</div><br></script>
html,body,iframe{
margin: 0;
padding: 0;
}
#nprogress{
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #f7f7f7;
z-index: 999;
}
.spinner-icon{
display: none!important;
}
.splash {
position:absolute;
top:40%;
left:0;
right:0;
margin: auto;
}
.splash img {
display: block;
margin-left: auto;
margin-right: auto;
height: 100px;
width: 100px;
}
.card {
background-color: #f7f7f7;
padding: 20px 25px 15px;
margin: 0 auto 25px;
width: 380px;
}
.mybar {
background: #29d;
height:10px;
}
.progress {
height: 10px;
overflow: hidden;
}
<script type="text/javascript">
$(function(){
NProgress.configure({
template: $(‘#myId‘).html() // template是用来设置动画样式的属性
});
NProgress.start();
});
$(window).load(function(){
NProgress.done();
})
</script>
<script type="text" id="myId">
<em id="__mceDel"><em id="__mceDel"><div class="bar" role="bar" style="display=block"><br> <div class="peg"></div><br> </div><br> <div class="spinner" role="spinner"><br> <div class="spinner-icon"></div><br> </div></em></em>
</script>
AMD
或者Browserify
来加载模块的话,这个会默认执行。<head>
<script src="/pace/pace.js"></script>
<link href="/pace/themes/pace-theme-barber-shop.css" rel="external nofollow" rel="stylesheet" /> <br> <!-- 此处的css样式就决定了加载进度动画的样式 -->
</head>
标签:百分比 center 有一个 star 停止 结束 win mil 执行
原文地址:http://www.cnblogs.com/liuna/p/7219085.html