首先在1.3.2中calendar控件不支持日历某天的颜色进行改变,和自定义回调函数

Name Type Description Default
width number The width of calendar component. 180
height number The height of calendar component. 180
fit boolean When true to set the calendar size fit it's parent container. false
border boolean Defines if to show the border. true
firstDay number Defines the first day of week. Sunday is 0, Monday is 1, ... 0
weeks array The list of week to be showed. ['S','M','T','W','T','F','S']
months array The list of month to be showed. ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
year number The year of calendar. The example below shows how to create a calendar using the specified year and month.

<div class="easyui-calendar" data-options="year:2012,month:6" />
current year(four digits)
month number The month of calendar. current month, start with 1
current Date The current date. current date
formatter function(date) The day formatter function, return the day value. This property is available since version 1.3.6.

Code example:

$('#cc').calendar({
formatter: function(date){
return date.getDate();
}
})
 
styler function(date) The styler function for calendar days, return the inline style or CSS class. This property is available since version 1.3.6.

Code example:

$('#cc').calendar({
styler: function(date){
if (date.getDay() == 1){
return 'background-color:#ccc';
// the function can return predefined css class and inline style
// return {class:'r1', style:{'color:#fff'}};
} else {
return '';
}
}
})
 
validator function(date) The validator function that is used to determine if a calendar day can be selected, return false to prevent from selecting a day. This property is available since version 1.3.6.

Code example:

$('#cc').calendar({
validator: function(date){
if (date.getDay() == 1){return true;}
else {return false;}
}
})

以上看出上面的有些方法和属性注明在1.3.6中使用 那我们使用以前的老版本怎么办?

因为页面上还有其它使用1.3.2的方法和属性。所以只有自己从easyui官方最新的插件包中查找了,经过整理了一下代码如下:

(function ($) {
    function _4ef(_4f0, _4f1) {
        var opts = $.data(_4f0, "calendar").options;
        var t = $(_4f0);
        if (_4f1) {
            $.extend(opts, { width: _4f1.width, height: _4f1.height });
        }
        t._size(opts, t.parent());
        t.find(".calendar-body")._outerHeight(t.height() - t.find(".calendar-header")._outerHeight());
        if (t.find(".calendar-menu").is(":visible")) {
            _4f2(_4f0);
        }
    };
    function init(_4f3) {
        $(_4f3).addClass("calendar").html("<div class=\"calendar-header\">" + "<div class=\"calendar-prevmonth\"></div>" + "<div class=\"calendar-nextmonth\"></div>" + "<div class=\"calendar-prevyear\"></div>" + "<div class=\"calendar-nextyear\"></div>" + "<div class=\"calendar-title\">" + "<span>Aprial 2010</span>" + "</div>" + "</div>" + "<div class=\"calendar-body\">" + "<div class=\"calendar-menu\">" + "<div class=\"calendar-menu-year-inner\">" + "<span class=\"calendar-menu-prev\"></span>" + "<span><input class=\"calendar-menu-year\" type=\"text\"></input></span>" + "<span class=\"calendar-menu-next\"></span>" + "</div>" + "<div class=\"calendar-menu-month-inner\">" + "</div>" + "</div>" + "</div>");
        $(_4f3).find(".calendar-title span").hover(function () {
            $(this).addClass("calendar-menu-hover");
        }, function () {
            $(this).removeClass("calendar-menu-hover");
        }).click(function () {
            var menu = $(_4f3).find(".calendar-menu");
            if (menu.is(":visible")) {
                menu.hide();
            } else {
                _4f2(_4f3);
            }
        });
        $(".calendar-prevmonth,.calendar-nextmonth,.calendar-prevyear,.calendar-nextyear", _4f3).hover(function () {
            $(this).addClass("calendar-nav-hover");
        }, function () {
            $(this).removeClass("calendar-nav-hover");
        });
        //$(_4f3).find(".calendar-nextmonth").click(function () {
        //    _4f5(_4f3, 1);
        //});
        //$(_4f3).find(".calendar-prevmonth").click(function () {
        //    _4f5(_4f3, -1);
        //});
        //$(_4f3).find(".calendar-nextyear").click(function () {
        //    _4f8(_4f3, 1);
        //});
        //$(_4f3).find(".calendar-prevyear").click(function () {
        //    _4f8(_4f3, -1);
        //});
        $(_4f3).bind("_resize", function (e, _4f4) {
            if ($(this).hasClass("easyui-fluid") || _4f4) {
                _4ef(_4f3);
            }
            return false;
        });
    };
    function _4f5(_4f6, _4f7) {
        var opts = $.data(_4f6, "calendar").options;
        opts.month += _4f7;
        if (opts.month > 12) {
            opts.year++;
            opts.month = 1;
        } else {
            if (opts.month < 1) {
                opts.year--;
                opts.month = 12;
            }
        }
        show(_4f6);
        var menu = $(_4f6).find(".calendar-menu-month-inner");
        menu.find("td.calendar-selected").removeClass("calendar-selected");
        menu.find("td:eq(" + (opts.month - 1) + ")").addClass("calendar-selected");
    };
    function _4f8(_4f9, _4fa) {
        var opts = $.data(_4f9, "calendar").options;
        opts.year += _4fa;
        show(_4f9);
        var menu = $(_4f9).find(".calendar-menu-year");
        menu.val(opts.year);
    };
    function _4f2(_4fb) {
        var opts = $.data(_4fb, "calendar").options;
        $(_4fb).find(".calendar-menu").show();
        if ($(_4fb).find(".calendar-menu-month-inner").is(":empty")) {
            $(_4fb).find(".calendar-menu-month-inner").empty();
            var t = $("<table class=\"calendar-mtable\"></table>").appendTo($(_4fb).find(".calendar-menu-month-inner"));
            var idx = 0;
            for (var i = 0; i < 3; i++) {
                var tr = $("<tr></tr>").appendTo(t);
                for (var j = 0; j < 4; j++) {
                    $("<td class=\"calendar-menu-month\"></td>").html(opts.months[idx++]).attr("abbr", idx).appendTo(tr);
                }
            }
            $(_4fb).find(".calendar-menu-prev,.calendar-menu-next").hover(function () {
                $(this).addClass("calendar-menu-hover");
            }, function () {
                $(this).removeClass("calendar-menu-hover");
            });
            $(_4fb).find(".calendar-menu-next").click(function () {
                var y = $(_4fb).find(".calendar-menu-year");
                if (!isNaN(y.val())) {
                    y.val(parseInt(y.val()) + 1);
                    _4fc();
                }
            });
            $(_4fb).find(".calendar-menu-prev").click(function () {
                var y = $(_4fb).find(".calendar-menu-year");
                if (!isNaN(y.val())) {
                    y.val(parseInt(y.val() - 1));
                    _4fc();
                }
            });
            $(_4fb).find(".calendar-menu-year").keypress(function (e) {
                if (e.keyCode == 13) {
                    _4fc(true);
                }
            });
            $(_4fb).find(".calendar-menu-month").hover(function () {
                $(this).addClass("calendar-menu-hover");
            }, function () {
                $(this).removeClass("calendar-menu-hover");
            }).click(function () {
                var menu = $(_4fb).find(".calendar-menu");
                menu.find(".calendar-selected").removeClass("calendar-selected");
                $(this).addClass("calendar-selected");
                _4fc(true);
            });
        }
        function _4fc(_4fd) {
            var menu = $(_4fb).find(".calendar-menu");
            var year = menu.find(".calendar-menu-year").val();
            var _4fe = menu.find(".calendar-selected").attr("abbr");
            if (!isNaN(year)) {
                opts.year = parseInt(year);
                opts.month = parseInt(_4fe);
                show(_4fb);
            }
            if (_4fd) {
                menu.hide();
            }
        };
        var body = $(_4fb).find(".calendar-body");
        var sele = $(_4fb).find(".calendar-menu");
        var _4ff = sele.find(".calendar-menu-year-inner");
        var _500 = sele.find(".calendar-menu-month-inner");
        _4ff.find("input").val(opts.year).focus();
        _500.find("td.calendar-selected").removeClass("calendar-selected");
        _500.find("td:eq(" + (opts.month - 1) + ")").addClass("calendar-selected");
        sele._outerWidth(body._outerWidth());
        sele._outerHeight(body._outerHeight());
        _500._outerHeight(sele.height() - _4ff._outerHeight());
    };
    function _501(_502, year, _503) {
        var opts = $.data(_502, "calendar").options;
        var _504 = [];
        var _505 = new Date(year, _503, 0).getDate();
        for (var i = 1; i <= _505; i++) {
            _504.push([year, _503, i]);
        }
        var _506 = [], week = [];
        var _507 = -1;
        while (_504.length > 0) {
            var date = _504.shift();
            week.push(date);
            var day = new Date(date[0], date[1] - 1, date[2]).getDay();
            if (_507 == day) {
                day = 0;
            } else {
                if (day == (opts.firstDay == 0 ? 7 : opts.firstDay) - 1) {
                    _506.push(week);
                    week = [];
                }
            }
            _507 = day;
        }
        if (week.length) {
            _506.push(week);
        }
        var _508 = _506[0];
        if (_508.length < 7) {
            while (_508.length < 7) {
                var _509 = _508[0];
                var date = new Date(_509[0], _509[1] - 1, _509[2] - 1);
                _508.unshift([date.getFullYear(), date.getMonth() + 1, date.getDate()]);
            }
        } else {
            var _509 = _508[0];
            var week = [];
            for (var i = 1; i <= 7; i++) {
                var date = new Date(_509[0], _509[1] - 1, _509[2] - i);
                week.unshift([date.getFullYear(), date.getMonth() + 1, date.getDate()]);
            }
            _506.unshift(week);
        }
        var _50a = _506[_506.length - 1];
        while (_50a.length < 7) {
            var _50b = _50a[_50a.length - 1];
            var date = new Date(_50b[0], _50b[1] - 1, _50b[2] + 1);
            _50a.push([date.getFullYear(), date.getMonth() + 1, date.getDate()]);
        }
        if (_506.length < 6) {
            var _50b = _50a[_50a.length - 1];
            var week = [];
            for (var i = 1; i <= 7; i++) {
                var date = new Date(_50b[0], _50b[1] - 1, _50b[2] + i);
                week.push([date.getFullYear(), date.getMonth() + 1, date.getDate()]);
            }
            _506.push(week);
        }
        return _506;
    };
    function show(_50c) {
        var opts = $.data(_50c, "calendar").options;
        if (opts.current && !opts.validator.call(_50c, opts.current)) {
            opts.current = null;
        }
        var now = new Date();
        var _50d = now.getFullYear() + "," + (now.getMonth() + 1) + "," + now.getDate();
        var _50e = opts.current ? (opts.current.getFullYear() + "," + (opts.current.getMonth() + 1) + "," + opts.current.getDate()) : "";
        var _50f = 6 - opts.firstDay;
        var _510 = _50f + 1;
        if (_50f >= 7) {
            _50f -= 7;
        }
        if (_510 >= 7) {
            _510 -= 7;
        }
        $(_50c).find(".calendar-title span").html(opts.months[opts.month - 1] + " " + opts.year);
        var body = $(_50c).find("div.calendar-body");
        body.children("table").remove();
        var data = ["<table class=\"calendar-dtable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"];
        data.push("<thead><tr>");
        for (var i = opts.firstDay; i < opts.weeks.length; i++) {
            data.push("<th>" + opts.weeks[i] + "</th>");
        }
        for (var i = 0; i < opts.firstDay; i++) {
            data.push("<th>" + opts.weeks[i] + "</th>");
        }
        data.push("</tr></thead>");
        data.push("<tbody>");
        var _511 = _501(_50c, opts.year, opts.month);
        for (var i = 0; i < _511.length; i++) {
            var week = _511[i];
            var cls = "";
            if (i == 0) {
                cls = "calendar-first";
            } else {
                if (i == _511.length - 1) {
                    cls = "calendar-last";
                }
            }
            data.push("<tr class=\"" + cls + "\">");
            for (var j = 0; j < week.length; j++) {
                var day = week[j];
                var s = day[0] + "," + day[1] + "," + day[2];
                var _512 = new Date(day[0], parseInt(day[1]) - 1, day[2]);
                var d = opts.formatter.call(_50c, _512);
                var css = opts.styler.call(_50c, _512);
                var _513 = "";
                var _514 = "";
                if (typeof css == "string") {
                    _514 = css;
                } else {
                    if (css) {
                        _513 = css["class"] || "";
                        _514 = css["style"] || "";
                    }
                }
                var cls = "calendar-day";
                if (!(opts.year == day[0] && opts.month == day[1])) {
                    cls += " calendar-other-month";
                }
                if (s == _50d) {
                    cls += " calendar-today";
                }
                if (s == _50e) {
                    cls += " calendar-selected";
                }
                if (j == _50f) {
                    cls += " calendar-saturday";
                } else {
                    if (j == _510) {
                        cls += " calendar-sunday";
                    }
                }
                if (j == 0) {
                    cls += " calendar-first";
                } else {
                    if (j == week.length - 1) {
                        cls += " calendar-last";
                    }
                }
                cls += " " + _513;
                if (!opts.validator.call(_50c, _512)) {
                    cls += " calendar-disabled";
                }
                data.push("<td class=\"" + cls + "\" abbr=\"" + s + "\" style=\"" + _514 + "\">" + d + "</td>");
            }
            data.push("</tr>");
        }
        data.push("</tbody>");
        data.push("</table>");
        body.append(data.join(""));
        var t = body.children("table.calendar-dtable").prependTo(body);
        t.find("td.calendar-day:not(.calendar-disabled)").hover(function () {
            $(this).addClass("calendar-hover");
        }, function () {
            $(this).removeClass("calendar-hover");
        }).click(function () {
            var _515 = opts.current;
            t.find(".calendar-selected").removeClass("calendar-selected");
            $(this).addClass("calendar-selected");
            var _516 = $(this).attr("abbr").split(",");
            opts.current = new Date(_516[0], parseInt(_516[1]) - 1, _516[2]);
            opts.onSelect.call(_50c, opts.current);
            if (!_515 || _515.getTime() != opts.current.getTime()) {
                opts.onChange.call(_50c, opts.current, _515);
            }
        });
    };
    $.fn.calendar = function (_517, _518) {
        if (typeof _517 == "string") {
            return $.fn.calendar.methods[_517](this, _518);
        }
        _517 = _517 || {};
        return this.each(function () {
            var _519 = $.data(this, "calendar");
            if (_519) {
                $.extend(_519.options, _517);
            } else {
                _519 = $.data(this, "calendar", { options: $.extend({}, $.fn.calendar.defaults, $.fn.calendar.parseOptions(this), _517) });
                init(this);
            }
            if (_519.options.border == false) {
                $(this).addClass("calendar-noborder");
            }
            _4ef(this);
            show(this);
            $(this).find("div.calendar-menu").hide();
        });
    };
    $.fn.calendar.methods = {
        options: function (jq) {
            return $.data(jq[0], "calendar").options;
        }, resize: function (jq, _51a) {
            return jq.each(function () {
                _4ef(this, _51a);
            });
        }, moveTo: function (jq, date) {
            return jq.each(function () {
                var opts = $(this).calendar("options");
                if (opts.validator.call(this, date)) {
                    var _51b = opts.current;
                    $(this).calendar({ year: date.getFullYear(), month: date.getMonth() + 1, current: date });
                    if (!_51b || _51b.getTime() != date.getTime()) {
                        opts.onChange.call(this, opts.current, _51b);
                    }
                }
            });
        }
    };

$.fn.calendar.parseOptions = function (_51c) {
        var t = $(_51c);
        return $.extend({}, $.parser.parseOptions(_51c, [{ firstDay: "number", fit: "boolean", border: "boolean" }]));
    };
    $.fn.calendar.defaults = {
        width: 180, height: 180, fit: false, border: true, firstDay: 0, weeks: ["S", "M", "T", "W", "T", "F", "S"], months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], year: new Date().getFullYear(), month: new Date().getMonth() + 1, current: (function () {
            var d = new Date();
            return new Date(d.getFullYear(), d.getMonth(), d.getDate());
        })(), formatter: function (date) {
            return date.getDate();
        }, styler: function (date) {
            return "";
        }, validator: function (date) {
            return true;
        }, onSelect: function (date) {
        }, onChange: function (_51d, _51e) {
        }
    };

$.fn._propAttr = $.fn.prop || $.fn.attr;
    $.fn._size = function (_14, _15) {
        if (typeof _14 == "string") {
            if (_14 == "clear") {
                return this.each(function () {
                    $(this).css({ width: "", minWidth: "", maxWidth: "", height: "", minHeight: "", maxHeight: "" });
                });
            } else {
                if (_14 == "unfit") {
                    return this.each(function () {
                        _16(this, $(this).parent(), false);
                    });
                } else {
                    if (_15 == undefined) {
                        return _17(this[0], _14);
                    } else {
                        return this.each(function () {
                            _17(this, _14, _15);
                        });
                    }
                }
            }
        } else {
            return this.each(function () {
                _15 = _15 || $(this).parent();
                $.extend(_14, _16(this, _15, _14.fit) || {});
                var r1 = _18(this, "width", _15, _14);
                var r2 = _18(this, "height", _15, _14);
                if (r1 || r2) {
                    $(this).addClass("easyui-fluid");
                } else {
                    $(this).removeClass("easyui-fluid");
                }
            });
        }
    }

function _16(_19, _1a, fit) {
        if (!_1a.length) {
            return false;
        }
        var t = $(_19)[0];
        var p = _1a[0];
        var _1b = p.fcount || 0;
        if (fit) {
            if (!t.fitted) {
                t.fitted = true;
                p.fcount = _1b + 1;
                $(p).addClass("panel-noscroll");
                if (p.tagName == "BODY") {
                    $("html").addClass("panel-fit");
                }
            }
            return { width: ($(p).width() || 1), height: ($(p).height() || 1) };
        } else {
            if (t.fitted) {
                t.fitted = false;
                p.fcount = _1b - 1;
                if (p.fcount == 0) {
                    $(p).removeClass("panel-noscroll");
                    if (p.tagName == "BODY") {
                        $("html").removeClass("panel-fit");
                    }
                }
            }
            return false;
        }
    };

function _18(_1c, _1d, _1e, _1f) {
        var t = $(_1c);
        var p = _1d;
        var p1 = p.substr(0, 1).toUpperCase() + p.substr(1);
        var min = parseValue("min" + p1, _1f["min" + p1], _1e);
        var max = parseValue("max" + p1, _1f["max" + p1], _1e);
        var val = parseValue(p, _1f[p], _1e);
        var _20 = (String(_1f[p] || "").indexOf("%") >= 0 ? true : false);
        if (!isNaN(val)) {
            var v = Math.min(Math.max(val, min || 0), max || 99999);
            if (!_20) {
                _1f[p] = v;
            }
            t._size("min" + p1, "");
            t._size("max" + p1, "");
            t._size(p, v);
        } else {
            t._size(p, "");
            t._size("min" + p1, min);
            t._size("max" + p1, max);
        }
        return _20 || _1f.fit;
    };

function parseValue(_6, _7, _8, _9) {
        _9 = _9 || 0;
        var v = $.trim(String(_7 || ""));
        var _a = v.substr(v.length - 1, 1);
        if (_a == "%") {
            v = parseInt(v.substr(0, v.length - 1));
            if (_6.toLowerCase().indexOf("width") >= 0) {
                v = Math.floor((_8.width() - _9) * v / 100);
            } else {
                v = Math.floor((_8.height() - _9) * v / 100);
            }
        } else {
            v = parseInt(v) || undefined;
        }
        return v;
    };

function _17(_21, _22, _23) {
        var t = $(_21);
        if (_23 == undefined) {
            _23 = parseInt(_21.style[_22]);
            if (isNaN(_23)) {
                return undefined;
            }
            if ($._boxModel) {
                _23 += _24();
            }
            return _23;
        } else {
            if (_23 === "") {
                t.css(_22, "");
            } else {
                if ($._boxModel) {
                    _23 -= _24();
                    if (_23 < 0) {
                        _23 = 0;
                    }
                }
                t.css(_22, _23 + "px");
            }
        }
        function _24() {
            if (_22.toLowerCase().indexOf("width") >= 0) {
                return t.outerWidth() - t.width();
            } else {
                return t.outerHeight() - t.height();
            }
        };
    };

})(jQuery);

把以上javascript代码保存一个文件页面直接引用即可,别忘了再引入中文包之前不然日历还有其它控件都是英文的了。

一下是我整理的一个日历排班效果,看着还不错,上一张图片吧!

通过点击的方式可以改变日历某一天的颜色。

以上代码希望能帮助到大家

easyui1.3.2中使用1.3.6或1.4.x的calendar的更多相关文章

  1. Java中常用来处理时间的三个类:Date、Calendar、SimpleDateFormate,以及Java中的单例设计模式:懒汉式、饿汉式以及静态内部类式

    (一)java.util.Date类 1.该类有一个long类型的属性:用来存放时间,是用毫秒数的形式表示,开始的日期是从1970年1月1号 00:00:00.    2.该类的很多方法都已经过时,不 ...

  2. 夏令时 DST (Daylight Saving Time) java中的夏令时【转】

    1916年,德国首先实行夏令时,英国因为怕德国会从中得到更大的效益,因此紧跟着也采取了夏令时 1986年至1991年,中华人民共和国在全国范围实行了六年夏令时 サマータイム 夏時間(日本现在没有实行夏 ...

  3. Android中关于日期时间与时区的使用总结

    在开发Android的过程中,出现过几次由于日期时间导致的问题,而且主要是由于时区的原因导致,所以一直想总结一下,形成一个良好的开发规范.   一.Unix时间戳   Unix时间戳(Unix tim ...

  4. TWaver初学实战——如何在TWaver属性表中添加日历控件?

    在日期输入框中添加日历控件,是一种非常流行和实用的做法.临渊羡鱼不如退而写代码,今天就看看在TWaver中是如何实现的.   资源准备   TWaver的在线使用文档中,就有TWaver Proper ...

  5. JDK中日期和时间的几个常用类浅析(二)

    java.util.Calendar   JDK中的java.util.Calendar类主要是用来处理日期和时间相关的算法运算.当你需要做一些关于日期和时间的高级算数操作时,此类可能就是你的最好选择 ...

  6. Java中常见设计模式面试

    一.设计模式的分类 总体来说设计模式分为三大类: 创建型模式,共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式. 结构型模式,共七种:适配器模式.装饰器模式.代理模式.外观模式.桥接 ...

  7. Swift3.0中关于日期类的使用指引

    日期的处理在大大小小的iOS项目中都十分常见,随着Swift3.0正式版的即将推出,语法的改变让NSDate以及相关类的使用都与之前略有不同,这里将会对基于Swift3.0版本的NSDate及相关类的 ...

  8. Java中date和calendar的用法

    获取现在系统的时间和日期看起来是一件非常神奇的事情,但是当使用date和calendar之后发现仍然非常神奇. 1.date 使用date日期之前需要导入包: import java.text.Sim ...

  9. 【深度思考】JDK8中日期类型该如何使用?

    在JDK8之前,处理日期时间,我们主要使用3个类,Date.SimpleDateFormat和Calendar. 这3个类在使用时都或多或少的存在一些问题,比如SimpleDateFormat不是线程 ...

随机推荐

  1. 国内第一部C#.Net调用Matlab混合编程视频教程

       本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新 Matlab和C#混合编程文章目录:[目录]Matlab和C#混合编程文章目录 一.视频说明 2014年的5.1,我将这套视频教 ...

  2. 《BI那点儿事》Microsoft 神经网络算法

    Microsoft神经网络是迄今为止最强大.最复杂的算法.要想知道它有多复杂,请看SQL Server联机丛书对该算法的说明:“这个算法通过建立多层感知神经元网络,建立分类和回归挖掘模型.与Micro ...

  3. 10分钟学会理解和解决MySQL乱码问题

    在阅读本文之前,强烈建议对字符集编码概念还比较模糊的同学 阅读下博主之前对相关概念的一篇科普:十分钟搞清字符集和字符编码 本博客已经迁移至: http://cenalulu.github.io/ 为了 ...

  4. 使用ab进行页面的压力测试

    ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab 参数说明及示例 我们可以模拟100个并发用户,对一个页面发送1000个请求 输入命令:ab - ...

  5. Android在一个Activity中关闭另一个Activity

    比如有ActivityA, ActivityB,在ActivityB中关闭ActivityA. 解决方案: 1.在 ActivityA 里面设置一个静态的变量instance,初始化为this,在 A ...

  6. ECharts+百度地图网络拓扑应用

    前一篇谈及到了ECharts整合HT for Web的网络拓扑图应用,后来在ECharts的Demo中看到了有关空气质量的相关报表应用,就想将百度地图.ECharts和HT for Web三者结合起来 ...

  7. HT for Web基于HTML5的图像操作(二)

    上篇介绍了HT for Web采用HTML5 Canvas的getImageData和setImageData函数,通过颜色乘积实现的染色效果,本文将再次介绍另一种更为高效的实现方式,当然要实现的功能 ...

  8. 基于HTML5技术的电力3D监控应用(二)

    上篇介绍了我们电力项目的基本情况,我们选用HTML5技术还是顶着很大压力,毕竟HTML5技术性能行不行,浏览器兼容性会不会有问题,这些在项目选型阶段还是充满疑惑,项目做到现在终于快收尾了我们才敢松口气 ...

  9. UI自动化测试框架(项目实战)python、Selenium(日志、邮件、pageobject)

    其实百度UI自动化测试框架,会出来很多相关的信息,不过就没有找到纯项目的,无法拿来使用的:所以我最近就写了一个简单,不过可以拿来在真正项目中可以使用的测试框架. 项目的地址:https://githu ...

  10. 如何提升我的HTML&CSS技术,编写有结构的代码

    前言 之前写了四篇HTML和CSS的知识点,也相当于是一个知识点汇总.有需要的可以收藏,平时开发过程中应该会遇到这些点,到时候再查看这些博客可能更容易理解.从这篇开始更多的介绍开发过程经常让人头痛的前 ...