html 动态 进度条,类型血条增加的,求代码加注释,简单就好。

就是这个,黄色的血条动态增加

第1个回答  2013-02-19

HTMl是静态的啦,要通过服务器才能实现动态的数据交互效果。

例如用户每选择一次,就将数据传回给服务器数据库中,服务器再根据运算返回票数变动后的各数据表现(如进程条增加一定比例的长度和增加等)

当然如果你只是想一次性显示最终结果,可以用一个div包含另一个div实现静态效果:

    <div style="width:400px;height:10px;background:#EDEDED;">

        <div style="background:#FFED04;width:70px;height:10px;"></div>

    </div>

追问

已经会了, 3Q

追答

额,刚弄了下js:

<script language="javascript" type="text/javascript" defer>

    window.onload=function(){

        var obtn=document.getElementById('btn');

        var opro=document.getElementById('pro');

        var wid=70;

        obtn.onclick=function(){

            wid+=30;

            opro.style.width=wid+'px';

        }

    }

</script>


HTML添加个按钮:

    <div style="width:400px;height:10px;background:#EDEDED;">

        <div id="pro" style="background:#FFED04;width:70px;height:10px;"></div>

    </div>

    <input id="btn" type="button" value="增加进程"/>


本回答被提问者采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网