zoukankan      html  css  js  c++  java
  • jquery 进度条

    果图
     
     

     
     
     
     
     
    [html] 
    <p><html> 
    <head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <title>bar</title> 
    <script type="text/javascript" src="jquery-1.8.0.min.js" ></script> 
    <style type="text/css"> 
    #time_back{300px;height:20px;border:1px solid #246;background:#CCC} 
    #time_bar{0;height:20px;background:#470;color:#FFF;text-align:right;} 
    #target_back{300px;height:20px;border:1px solid #246;background:#CCC} 
    #target_bar{0;height:20px;background:#470;color:#FFF;text-align:right;} 
    </style> 
    <script type="text/javascript"> 
    $(document).ready(function(){</p><p>  
     $("#input_time").change(function(){ 
      var rate = $(this).attr("value"); 
      changebar("#time_bar",rate,"red"); 
     }); 
      
     $("#input_target").change(function(){ 
      var rate = $(this).attr("value"); 
      changebar("#target_bar",rate,"orange"); 
     }); 
      
     /** 
     * 更新进度条 
     * @ param obj 进度条id 
     * @ param rate 进度,0-100间的整数 
     * @ param deadColor 当进度超过一定值(默认80)的颜色 
     */ 
     function changebar(obj,rate,deadColor){ 
      if(undefined!=deadColor&&rate>80){ 
       $(obj).css({"background":deadColor}) 
      } 
      rate = rate%100 + "%"; 
      $(obj).animate({rate},1000); 
      $(obj).html(rate); 
     } 
    }); 
    </script> 
    <body> 
    日期:<div id="time_back" ><div id="time_bar" ></div></div> 
    进度:<div id="target_back" ><div id="target_bar" ></div></div> 
    <input type="text" id="input_time" /> 
    <input type="text" id="input_target" /> 
    </body> 
    </html></p> 

  • 相关阅读:
    数值分析实验之数值积分法(java 代码)
    Python 数据处理
    Python 网络爬虫
    数据库系统开发——旅游公司机票查询及预订系统
    Python词云生成
    Python库的安装与查看
    Python词频统计
    Python程序设计训练
    Python编程基础训练
    如何在同一Linux服务器上创建多站点
  • 原文地址:https://www.cnblogs.com/qingzhouyi/p/3140693.html
Copyright © 2011-2022 走看看