标签:var top setw clientx window eth java style his
1 function fnMove(ev) { 2 var event = ev || window.event; 3 var l = event.clientX - this.disX; 4 var t = event.clientY - this.disY 5 6 7 if (l < 0) { 8 l = 0; 9 } 10 else if (l > document.documentElement.clientWidth - this.oDiv.offsetWidth) { 11 12 l = document.documentElement.clientWidth - this.oDiv.offsetWidth 13 } 14 ; 15 16 if (t < 0) { 17 t = 0; 18 } 19 else if (t > document.documentElement.clientHeight - this.oDiv.offsetHeight) { 20 21 t = document.documentElement.clientHeight - this.oDiv.offsetHeight 22 } 23 24 this.oDiv.style.left = l + ‘px‘;
25 this.oDiv.style.top = t + ‘px‘;
标签:var top setw clientx window eth java style his
原文地址:http://www.cnblogs.com/gogeek/p/6678707.html