zoukankan      html  css  js  c++  java
  • web Form进度条

    Css

            /*进度条*/
            .box {
                position: relative;
                width: 210px;
                height: 50px;
                border: 1px solid #fffdfd;
                margin: 0 0 0 0;
            }
    
            .bg {
                height: 10px;
                margin-top: 19px;
                border: 1px solid #ddd;
                border-radius: 5px;
                overflow: hidden;
            }
    
            .bgcolor {
                background: #5889B2;
                width: 0;
                height: 10px;
                border-radius: 5px;
            }
    
            .bt {
                width: 24px;
                height: 24px;
                background-color: #494990;
                border-radius: 17px;
                overflow: hidden;
                position: absolute;
                left: 0px;
                margin-left: -11px;
                top: 12px;
                cursor: pointer;
            }
    
            .text {
                width: 210px;
                margin: 0 auto;
                font-size: 16px;
                line-height: 2em;
            }
            /*进度条*/

    aspx

      <div class="box" id="box1">
                                                            <div class="bg" id="bg1">
                                                                <div class="bgcolor" id="bgcolor1"></div>
                                                            </div>
                                                            <div class="bt" id="bt1"></div>
                                                        </div>
    //进度条
            (function ($) {
                var $box = $('#box1');
                var $bg = $('#bg1');
                var $bgcolor = $('#bgcolor1');
                var $btn = $('#bt1');
                var $numAuditPriceScore = $('#ctl00_CH_rp2_numAuditPriceScore_I');
                var statu = false;
                var ox = 0;
                var lx = 0;
                var left = 0;
                var bgleft = 0;
                $btn.mousedown(function (e) {
                    lx = $btn.offset().left;
                    ox = e.pageX - left;
                    statu = true;
                });
                $(document).mouseup(function () {
                    statu = false;
                });
                $box.mousemove(function (e) {
                    if (statu) {
                        left = e.pageX - ox;
                        if (left < 0) {
                            left = 0;
                        }
                        if (left > 200) {
                            left = 200;
                        }
                        $btn.css('left', left);
                        $bgcolor.width(left);
                        $numAuditPriceScore.val(parseInt(left / 2));
                    }
                });
                $bg.click(function (e) {
                    if (!statu) {
                        bgleft = $bg.offset().left;
                        left = e.pageX - bgleft;
                        if (left < 0) {
                            left = 0;
                        }
                        if (left > 200) {
                            left = 200;
                        }
                        $btn.css('left', left);
                        $bgcolor.stop().animate({  left }, 200);
                        $numAuditPriceScore.val(parseInt(left / 2));
                    }
                });
            })(jQuery);

     后台绑定:

       numAuditPriceScore.ClientSideEvents.LostFocus = "function(s,e){  var AuditPriceScore = $('#ctl00_CH_rp2_numAuditPriceScore_I').val(); $('#bt1').css('left', parseInt(AuditPriceScore * 2));$('#bgcolor1').stop().animate({  parseInt(AuditPriceScore * 2) }, 200);}";
  • 相关阅读:
    Pydev Console中文提示乱码的问题
    pg_dump命令帮助信息
    Aptana下Django1.6以后的项目模板结构改造
    老外的项目开发在线服务网站资源
    淘宝技术交流笔记
    Python并发编程的几篇文章
    gevent程序员指南
    IOS UITableView拖动排序功能
    Codeforces 300A Array
    一次mysql优化经历
  • 原文地址:https://www.cnblogs.com/gsh0921/p/12530431.html
Copyright © 2011-2022 走看看