HTML5进度条绑定输出结果示例及滑动条动态调整颜色示例
使用range类型
fieldset{width:280px;height:150px;padding:10px;}
#slide{width:150px;float:left;margin-bottom:20px;}
#preview{width:80px;
height:80px;
float:right;
border:1px solid blue;
}
#strclr{clear:both;text-align:center;font-weight:bold;}
#hpu:before{content:"5";font-family:webdings;color:red;}
#hpu:after{content:url(img/ppt.jpg); }
var intR,intG,intB,strColor; function setColor(){ intR=document.getElementById("txtR").value; intG=document.getElementById("txtG").value; intB=document.getElementById("txtB").value; strColor="rgb("+intR+","+intG+","+intB+")"; document.getElementById("strclr").innerHTML=strColor; document.getElementById("preview").style.backgroundColor=strColor; }
滑动条动态调整颜色
rgb(0,0,0)
%
var prg1=document.getElementById("prg"); setInterval(function(){ prg1.value+=1; output.value=prg.value; },100)
0
xxxx大学计算机学院文件