当前位置: 代码迷 >> HTML/CSS >> 请问怎么在滚动条上显示进度文字
  详细解决方案

请问怎么在滚动条上显示进度文字

热度:298   发布时间:2012-02-25 10:01:48.0
请教如何在滚动条上显示进度文字
如下所示:
  『-----80%-----』
这里的百分比例直接显示在滚动条上,而且实时反映滚动条的当前长度

------解决方案--------------------
恐怕只有自己模拟个滚动条吧!
------解决方案--------------------
<style type= "text/css ">
.jdtiao{font-size:12px; position:relative; height:15px; line-height:15px; width:100%; background:#ccc; width:100px; border:1px solid #00f}
.tiao{background:#f60; height:15px;}
.bfb{position:absolute; width:100%; color:#fff; font-weight:bold; text-align:center}

</style>
<div class= "jdtiao "> <div class= "bfb "> 80% </div> <div style= "width:80%; " class= "tiao "> </div> </div>

实时的就要用JS和后台程序交互了
  相关解决方案