Ⅰ html 动态 进度条,类型血条增加的,求代码加注释,简单就好。
HTMl是静态的啦,要通过服务器才能实现动态的数据交互效果。
例如用户每选择一次,就将数据传回给服务器数据库中,服务器再根据运算返回票数变动后的各数据表现(如进程条增加一定比例的长度和百分数增加等)
当然如果你只是想一次性显示最终结果,可以用一个div包含另一个div实现静态效果:
<divstyle="width:400px;height:10px;background:#EDEDED;">
<divstyle="background:#FFED04;width:70px;height:10px;"></div>
</div>
Ⅱ html5 css3 怎么制作简单的进度条
HTML代码:
<section class="container">
<div class="progress">
<span style="width: 20%;"><span>20%</span></span>
</div>
<div class="progress">
<span class="green" style="width: 40%;"><span>40%</span></span>
</div>
<div class="progress">
<span class="orange" style="width: 60%;"><span>60%</span></span>
</div>
<div class="progress">
<span class="red" style="width: 80%;"><span>80%</span></span>
</div>
<div class="progress">
<span class="blue" style="width: 100%;"><span>100%</span></span>
</div>
</section>
从HTML结构中我们可以看出,类名为progress的div是整个进度条的父容器,里面的span则是当前进度,通过width来定义不同的进度值,同时定义不同的颜色类,比如orange,以便待会在CSS中进行样式渲染。
CSS代码:
.progress {
height: 20px;
background: #ebebeb;
border-left: 1px solid transparent;
border-right: 1px solid transparent;
border-radius: 10px;
}
.progress > span {
position: relative;
float: left;
margin: 0 -1px;
min-width: 30px;
height: 18px;
line-height: 16px;
text-align: right;
background: #cccccc;
border: 1px solid;
border-color: #bfbfbf #b3b3b3 #9e9e9e;
border-radius: 10px;
background-image: -webkit-linear-gradient(top, #f0f0f0 0%, #dbdbdb 70%, #cccccc 100%);
background-image: -moz-linear-gradient(top, #f0f0f0 0%, #dbdbdb 70%, #cccccc 100%);
background-image: -o-linear-gradient(top, #f0f0f0 0%, #dbdbdb 70%, #cccccc 100%);
background-image: linear-gradient(to bottom, #f0f0f0 0%, #dbdbdb 70%, #cccccc 100%);
-webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}
.progress > span > span {
padding: 0 8px;
font-size: 11px;
font-weight: bold;
color: #404040;
color: rgba(0, 0, 0, 0.7);
text-shadow: 0 1px rgba(255, 255, 255, 0.4);
}
.progress > span:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
height: 18px;
background: url("../img/progress.png") 0 0 repeat-x;
border-radius: 10px;
}
.progress .green {
background: #85c440;
border-color: #78b337 #6ba031 #568128;
background-image: -webkit-linear-gradient(top, #b7dc8e 0%, #99ce5f 70%, #85c440 100%);
background-image: -moz-linear-gradient(top, #b7dc8e 0%, #99ce5f 70%, #85c440 100%);
background-image: -o-linear-gradient(top, #b7dc8e 0%, #99ce5f 70%, #85c440 100%);
background-image: linear-gradient(to bottom, #b7dc8e 0%, #99ce5f 70%, #85c440 100%);
}
.progress .red {
background: #db3a27;
border-color: #c73321 #b12d1e #8e2418;
background-image: -webkit-linear-gradient(top, #ea8a7e 0%, #e15a4a 70%, #db3a27 100%);
background-image: -moz-linear-gradient(top, #ea8a7e 0%, #e15a4a 70%, #db3a27 100%);
background-image: -o-linear-gradient(top, #ea8a7e 0%, #e15a4a 70%, #db3a27 100%);
background-image: linear-gradient(to bottom, #ea8a7e 0%, #e15a4a 70%, #db3a27 100%);
}
.progress .orange {
background: #f2b63c;
border-color: #f0ad24 #eba310 #c5880d;
background-image: -webkit-linear-gradient(top, #f8da9c 0%, #f5c462 70%, #f2b63c 100%);
background-image: -moz-linear-gradient(top, #f8da9c 0%, #f5c462 70%, #f2b63c 100%);
background-image: -o-linear-gradient(top, #f8da9c 0%, #f5c462 70%, #f2b63c 100%);
background-image: linear-gradient(to bottom, #f8da9c 0%, #f5c462 70%, #f2b63c 100%);
}
.progress .blue {
background: #5aaadb;
border-color: #459fd6 #3094d2 #277db2;
background-image: -webkit-linear-gradient(top, #aed5ed 0%, #7bbbe2 70%, #5aaadb 100%);
background-image: -moz-linear-gradient(top, #aed5ed 0%, #7bbbe2 70%, #5aaadb 100%);
background-image: -o-linear-gradient(top, #aed5ed 0%, #7bbbe2 70%, #5aaadb 100%);
background-image: linear-gradient(to bottom, #aed5ed 0%, #7bbbe2 70%, #5aaadb 100%);
}
Ⅲ html5进度条怎么写
首先,我们制作的这个进度条并没有后台数据作为支撑,所以是一个靠js实现的一个简单的页面。
我们首先需要新建一个html5的页面,其使用的progress元素实在html5时代才出现的。
我们在新建的页面中,输入一个段落标签,一个进度条,一个button按钮。
然后,我们需要设置一下进度条显示的进度。value代表从多少开始,max代表到多少结束。我们做的是百分比形式的,应该写成这样的。
这些做好之后,我们需要书写两个小的事件,实现原理大体上是鼠标单击下载按钮,开始下载变为正在下载百分之多少,等到达到我们预设的时间后显示下载完成。
我们之前已经给p标签和progress标签分别赋予了不同的id,我们需要获取到这两个元素,并将他们赋给两个变量。
我们还要将progress的初始值设为0,当鼠标单击的时候,我们以一定的时间为周期调用写好的事件。
函数写好之后,我们在浏览器中调试,点击下载按钮之后会在300ms内完成下载时间。
Ⅳ HTML5简单进度条代码,JS中总是报错不能设置null的innerHTML,代码如下,如何解决
两种改法:要么把你引入的 script 标签,放到 body 的底下;要么把你的 JS 代码用 window.onload = function () { ... } 括起来。
原因很简单,HTML 从上至下加载、JS 从上至下执行。由于你的 JS 文件先于 <div id='fill'> 被加载进来且执行,当执行到
varfill=document.getElementById('fill');
时,页面中的 #fill 元素并未被加载进来,所以此时变量 fill 的值是 null。
Ⅳ html:5中用什么代码可以使进度条能拓宽到和表格一样宽
参考代码如下:
<tableborder="1"width="960px"><tr><th>Month</th><th>Savings</th></tr><tr><tdwidth="500px">固定宽度</td><tdwidth="460px">固定宽度</td></tr><tr><td>固定宽度</td><td>固定宽度</td></tr></table>
定义和用法
width 属性规定表格单元格的宽度。
通常,单元格占用的空间就是它显示内容需要的空间。width 属性用于为单元格设置预定义的宽度。
Ⅵ html进度条代码怎么把文字移到外面
1.实现的效果如图所示:文字代表用户输入的对自己的个人介绍,两张图片随着文字的增加,始终排列在个人介绍的右边
效果看起来没有什么难度,不过写起来的时候,着实费了脑筋,一小伙伴对这样一个布局,用起来多分辨率适配的方案,想想就觉得。。。
这个布局只要抓住一点:别让两个图片被文字挤出图片即可。
第一,你不能设置图片固定在右边,因为它是随文字动的
第二,文字是根据屏幕来的,你不管设置为wrap还是match都会把图片挤出屏幕
先来一个麻烦的实现方案
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/home_my_center_username_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:maxWidth="@dimen/home_my_center_name_txt_width"
android:text=""
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/common_txt_big_size" />
<ImageView
android:id="@+id/home_my_center_gender_img"
android:layout_width="@dimen/home_my_center_gender_img_height"
android:layout_height="@dimen/home_my_center_gender_img_height"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/home_my_center_gender_img_margin_left"
android:layout_marginStart="@dimen/home_my_center_gender_img_margin_left"
android:src="@mipmap/account_male_ic" />
<ImageButton
android:id="@+id/home_my_center_edit_img"
android:layout_width="@dimen/home_my_center_gender_img_height"
android:layout_height="@dimen/home_my_center_gender_img_height"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/home_my_center_edit_img_margin_left"
android:layout_marginStart="@dimen/home_my_center_edit_img_margin_left"
android:background="@android:color/white"
android:src="@mipmap/cpattern_1" />
</LinearLayout>
Ⅶ 求用html的table或div模拟迅雷下载的进度条中间有百分比显示的代码
<style>
#progressbar{
width:500px;
height:40px;
display:block;
position:relative;
border:1pxsolid#aaa;
}
#progressbar#sel{
width:250px;
height:40px;
display:block;
background:#f0f;
}
#progressbar#percent{
position:absolute;
line-height:40px;
width:500px;
height:40px;
top:0px;
left:0px;
text-align:center;
}
</style>
<divid="progressbar"><divid="sel"></div><divid="percent"><spanid="num">50%<span></div></div>
<script>
varsel=0;
functionprogress(){
document.getElementById("sel").style.width=(sel*100/500)+"%";
document.getElementById("num").innerHTML=(sel*100/500)+"%";
sel+=5;
if(sel>=500){
sel=0;
}
}
setInterval("progress()",50);
</script>
以上代码你另存成html看下效果,如果可以请采纳下我的回答。
Ⅷ html 播放器进度条代码
你可以用这个播放器 可以播放视频和音乐(视频要求为WMV格式的)这个有进度条
将下列代码放入<body>
<embed src="周杰伦 - 跨时代.mp3" autostart="true" loop="1">
Ⅸ 音乐播放器进度条的html代码
嘿嘿,你把高度参数改成65就看到了:
<EMBED style="FILTER: gray()" src=http://s.71mp3.com/downmusic/707/1927.mp3 width=300 height=65 type=audio/mpeg autostart=autostart loop=-1 volume=0 showstatusbar=1></EMBED>
高度太低,被遮住了。
Ⅹ 这个html网页跳转带有进度条的跳转代码怎么做
可以用html5实现,也可以做成gif的图片,你只需要设置为和你程序设置一样的时间然后进度条自动结束就好了。用图片是最好实现,用ps软件就可以制作。
这个的实现,有很多中方法,简单的,是使用 DIV 嵌套,例如:
<div style="width: 100px; height: 10px; border: solid 1px #ccc;text-align: left">
<div style="width: 64px;height: 8px;background-color: #abc000"></div>
</div>
100px 代表 100 分, 64px 代表实际的得分
该进度条是100毫秒,+ 1% ,10秒钟后,跳转页面!要改时间的话!改100就好了