这压缩靠谱么【已解惑】

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在函数体第四行之后就没再用了,所以在第五行就开始被覆盖了。

原文地址:https://www.cnblogs.com/arliang/p/2994502.html