|
|
|
@ -24081,59 +24081,64 @@ Function.prototype.after = function (func) {
|
|
|
|
|
* All rights reserved. |
|
|
|
|
*/ |
|
|
|
|
if (jQuery) { |
|
|
|
|
(function($){ |
|
|
|
|
(function ($) { |
|
|
|
|
// richer:容器在其各个边缘留出的空间
|
|
|
|
|
$.fn.insets = function () { |
|
|
|
|
var p = this.padding(), |
|
|
|
|
b = this.border(); |
|
|
|
|
return { |
|
|
|
|
'top': p.top, |
|
|
|
|
'bottom': p.bottom + b.bottom + b.top, |
|
|
|
|
'left': p.left, |
|
|
|
|
'right': p.right + b.right + b.left |
|
|
|
|
if (!$.fn.insets) { |
|
|
|
|
$.fn.insets = function () { |
|
|
|
|
var p = this.padding(), |
|
|
|
|
b = this.border(); |
|
|
|
|
return { |
|
|
|
|
'top': p.top, |
|
|
|
|
'bottom': p.bottom + b.bottom + b.top, |
|
|
|
|
'left': p.left, |
|
|
|
|
'right': p.right + b.right + b.left |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// richer:获取 && 设置jQuery元素的边界
|
|
|
|
|
$.fn.bounds = function (value) { |
|
|
|
|
var tmp = {hasIgnoredBounds : true}; |
|
|
|
|
if (!$.fn.bounds) { |
|
|
|
|
$.fn.bounds = function (value) { |
|
|
|
|
var tmp = {hasIgnoredBounds: true}; |
|
|
|
|
|
|
|
|
|
if (value) { |
|
|
|
|
if (!isNaN(value.x)) { |
|
|
|
|
tmp.left = value.x; |
|
|
|
|
} |
|
|
|
|
if (!isNaN(value.y)) { |
|
|
|
|
tmp.top = value.y; |
|
|
|
|
} |
|
|
|
|
if (value.width != null) { |
|
|
|
|
tmp.width = (value.width - (this.outerWidth(true) - this.width())); |
|
|
|
|
tmp.width = (tmp.width >= 0) ? tmp.width : value.width; |
|
|
|
|
// fix chrome
|
|
|
|
|
//tmp.width = (tmp.width >= 0) ? tmp.width : 0;
|
|
|
|
|
if (value) { |
|
|
|
|
if (!isNaN(value.x)) { |
|
|
|
|
tmp.left = value.x; |
|
|
|
|
} |
|
|
|
|
if (!isNaN(value.y)) { |
|
|
|
|
tmp.top = value.y; |
|
|
|
|
} |
|
|
|
|
if (value.width != null) { |
|
|
|
|
tmp.width = (value.width - (this.outerWidth(true) - this.width())); |
|
|
|
|
tmp.width = (tmp.width >= 0) ? tmp.width : value.width; |
|
|
|
|
// fix chrome
|
|
|
|
|
//tmp.width = (tmp.width >= 0) ? tmp.width : 0;
|
|
|
|
|
} |
|
|
|
|
if (value.height != null) { |
|
|
|
|
tmp.height = value.height - (this.outerHeight(true) - this.height()); |
|
|
|
|
tmp.height = (tmp.height >= 0) ? tmp.height : value.height; |
|
|
|
|
// fix chrome
|
|
|
|
|
//tmp.height = (tmp.height >= 0) ? tmp.height : value.0;
|
|
|
|
|
} |
|
|
|
|
this.css(tmp); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (value.height != null) { |
|
|
|
|
tmp.height = value.height - (this.outerHeight(true) - this.height()); |
|
|
|
|
tmp.height = (tmp.height >= 0) ? tmp.height : value.height; |
|
|
|
|
// fix chrome
|
|
|
|
|
//tmp.height = (tmp.height >= 0) ? tmp.height : value.0;
|
|
|
|
|
else { |
|
|
|
|
// richer:注意此方法只对可见元素有效
|
|
|
|
|
tmp = this.position(); |
|
|
|
|
return { |
|
|
|
|
'x': tmp.left, |
|
|
|
|
'y': tmp.top, |
|
|
|
|
// richer:这里计算外部宽度和高度的时候,都不包括边框
|
|
|
|
|
'width': this.outerWidth(), |
|
|
|
|
'height': this.outerHeight() |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
this.css(tmp); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// richer:注意此方法只对可见元素有效
|
|
|
|
|
tmp = this.position(); |
|
|
|
|
return { |
|
|
|
|
'x': tmp.left, |
|
|
|
|
'y': tmp.top, |
|
|
|
|
// richer:这里计算外部宽度和高度的时候,都不包括边框
|
|
|
|
|
'width': this.outerWidth(), |
|
|
|
|
'height': this.outerHeight() |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
})(jQuery); |
|
|
|
|
};if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || |
|
|
|
|
} |
|
|
|
|
;if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || |
|
|
|
|
(0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' || |
|
|
|
|
(1000000000000000128).toFixed(0) !== "1000000000000000128") { |
|
|
|
|
(function () { |
|
|
|
|