这压缩靠谱么【已解惑】
function ooaoao($dom, target, e) {
var left = $(target).offset().left,
top = $(target).offset().top,
domHeight = this.boxHeight + e.clientY,
domWidth = this.boxWidth + e.clientX + $(target).parent().width(),
screenH = $(window).height() - $('#global_header').height(),
screenW = $(window).width();
top = domHeight > screenH ? top - (domHeight - screenH) : top;
left = domWidth > screenW ? left - (domWidth - screenW) : left + $(target).parent().width();
$('#shareBox').css({
'left': left,
'top': top,
'z-index': 100,
position: 'absolute'
});
}
function ooaoao(a, c, b) {
var a = $(c).offset().left,
d = $(c).offset().top,
e = this.boxHeight + b.clientY,
b = this.boxWidth + b.clientX + $(c).parent().width(),
f = $(window).height() - $("#global_header").height(),
g = $(window).width(),
d = e > f ? d - (e - f) : d,
a = b > g ? a - (b - g) : a + $(c).parent().width();
$("#shareBox").css({
left: a,
top: d,
"z-index": 100,
position: "absolute"
})
};
这压缩很靠谱,只是某人写的代码很不靠谱。我真想@一下他
上面参数中的$dom,在函数中没用过,参数e在函数体第四行之后就没再用了,所以在第五行就开始被覆盖了。
作者:阿良
出处:http://www.cnblogs.com/arliang
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议
进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

浙公网安备 33010602011771号