zoukankan      html  css  js  c++  java
  • 这压缩靠谱么【已解惑】

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

  • 相关阅读:
    Struts2框架
    读者写者问题
    哲学家就餐问题
    理解中断
    理解处理机调度
    理解死锁
    理解进程
    Linux CentOS 6.7 挂载U盘
    家庭-养老院模型理解IOC和DI
    Bash基础
  • 原文地址:https://www.cnblogs.com/arliang/p/2994502.html
Copyright © 2011-2022 走看看