内部方法, 供tips等小弹窗使用。
§ 原型:
cmstop.pos(
pos, // 'top'(中上), 'right'(右上), 'center'(居中), event, DOMElement, jQuery Object
width, // 需要定位的元素的占用宽度offsetWidth, 用来计算水平定位
height // 需要定位的元素的占用高度offsetHeight, 用来计算垂直定位
);
§ 返回值:
{
top:<int>,
left:<int>
}
§ 举例:
var tips = $('<div style="width:300px;height:400px"></div>').appendTo(document.body);
var pos = cmstop.pos('center', tips.outerHeight(true), tips.outerWidth(true));