zDialgo 是否有更全面的兼容,我没有测试过,毕竟zDialog2.0是1999年生产的。在这里发现zDialog有个不完美的地方,就是窗口大小的百分比不起作用,只有像素值起作用,看了zDialog.js的代码,发现是压根就没有处理百分比的情况,所以修改如下:在zDialog.js的第200行左右,由原来的
Dialog.prototype.create = function() {
var bd = $bodyDimensions(topWin);
if (typeof(this.OKEvent) == "function") this.ShowButtonRow = true;
//修改为:
Dialog.prototype.create = function() {
var bd = $bodyDimensions(topWin);
//添加开始,如果是百分比,则换成像素值 2016-10-19 郑爱军 QQ:125315695
if (typeof this.Width === "string") {
if (this.Width.lastIndexOf("%") > 0) {
this.Width = bd.clientWidth * this.Width.substr(0, this.Width.indexOf("%")) / 100;
}
}
if (typeof this.Height === "string") {
if (this.Height.lastIndexOf("%") > 0) {
this.Height = bd.clientHeight * this.Height.substr(0, this.Height.indexOf("%")) / 100;
}
}
//添加结束
if (typeof(this.OKEvent) == "function") this.ShowButtonRow = true;