| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 400 人关注过本帖
标题:是它屏蔽了左键吗?
取消只看楼主 加入收藏
downdown
Rank: 1
等 级:新手上路
帖 子:139
专家分:0
注 册:2005-6-20
收藏
 问题点数:0 回复次数:1 
是它屏蔽了左键吗?

<SCRIPT language=JavaScript>
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.left += percent;
lastScrollX = lastScrollX + percent;
}
}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocus(x,y) {
stalkerx = document.floater.pageX;
stalkery = document.floater.pageY;
stalkerwidth = document.floater.clip.width;
stalkerheight = document.floater.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
function grabIt(e) {
if(IE) {
whichIt = event.srcElement;
while (whichIt.id.indexOf("floater") == -1) {
whichIt = whichIt.parentElement;
if (whichIt == null) { return true; }
}
whichIt.style.pixelLeft = whichIt.offsetLeft;
whichIt.style.pixelTop = whichIt.offsetTop;
currentX = (event.clientX + document.body.scrollLeft);
currentY = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater;
StalkerTouchedX = e.pageX-document.floater.pageX;
StalkerTouchedY = e.pageY-document.floater.pageY;
}
}
return true;
}
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY);
currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX;
whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;
}
return false;
}
function dropIt() {
whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
<!-- DRAG DROP CODE -->
if(NS) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt;
}
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt;
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</SCRIPT>
<SCRIPT language=JavaScript>
self.onError=null;
currentA = currentB = 0;
whichId = null;
lastScrolla = 0; lastScrollb = 0;
ns = (document.layers) ? 1 : 0;
ie = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeatt() {
if(ie) { diffb = document.body.scrollTop; diffa = document.body.scrollLeft; }
if(ns) { diffb = self.pageYOffset; diffa = self.pageXOffset; }
if(diffb != lastScrollb) {
percent1 = .1 * (diffb - lastScrollb);
if(percent1 > 0) percent1 = Math.ceil(percent1);
else percent1 = Math.floor(percent1);
if(ie) document.all.floater1.style.pixelTop += percent1;
if(ns) document.floater1.top += percent1;
lastScrollb = lastScrollb + percent1;
}
if(diffa != lastScrolla) {
percent1 = .1 * (diffa - lastScrolla);
if(percent1 > 0) percent1 = Math.ceil(percent1);
else percent1 = Math.floor(percent1);
if(ie) document.all.floater1.style.pixelLeft += percent1;
if(ns) document.floater1.left += percent1;
lastScrolla = lastScrolla + percent1;
}
}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocuss(x,y) {
stalkerx = document.floater1.pageX;
stalkery = document.floater1.pageY;
stalkerwidth = document.floater1.clip.width;
stalkerheight = document.floater1.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
<!--//no
function grabItt(e) {
if(ie) {
whichId = event.srcElement;
while (whichId.id.indexOf("floater") == -1) {
whichId = whichId.parentElement;
if (whichId == null) { return true; }
}
whichId.style.pixelLeft = whichId.offsetLeft;
whichId.style.pixelTop = whichId.offsetTop;
currentA = (event.clientX + document.body.scrollLeft);
currentB = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocuss (e.pageX,e.pageY)) {
whichId = document.floater1;
StalkerTouchedX = e.pageX-document.floater1.pageX;
StalkerTouchedY = e.pageY-document.floater1.pageY;
}
}
return true;
}
-->


function moveItt(e) {
if (whichId == null) { return false; }
if(ie) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentA); distanceY = (newY - currentB);
currentA = newX; currentB = newY;
whichId.style.pixelLeft += distanceX;
whichId.style.pixelTop += distanceY;
if(whichId.style.pixelTop < document.body.scrollTop) whichId.style.pixelTop = document.body.scrollTop;
if(whichId.style.pixelLeft < document.body.scrollLeft) whichId.style.pixelLeft = document.body.scrollLeft;
if(whichId.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichId.style.pixelWidth - 20) whichId.style.pixelLeft = document.body.offsetWidth - whichId.style.pixelWidth - 20;
if(whichId.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichId.style.pixelHeight - 5) whichId.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichId.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichId.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichId.left < 0+self.pageXOffset) whichId.left = 0+self.pageXOffset;
if(whichId.top < 0+self.pageYOffset) whichId.top = 0+self.pageYOffset;
if( (whichId.left + whichId.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichId.left = ((window.innerWidth+self.pageXOffset)-whichId.clip.width)-17;
if( (whichId.top + whichId.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichId.top = ((window.innerHeight+self.pageYOffset)-whichId.clip.height)-17;
return false;
}
return false;
}

function dropItt() {
whichId = null;
if(ns) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
<!-- DRAG DROP CODE -->
if(ns) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabItt;
window.onmousemove = moveItt;
window.onmouseup = dropItt;
}
if(ie) {
document.onmousedown = grabItt;
document.onmousemove = moveItt;
document.onmouseup = dropItt;
}
if(ns || ie) action = window.setInterval("heartBeatt()",1);
</SCRIPT>

搜索更多相关主题的帖子: 左键 
2006-05-15 17:52
downdown
Rank: 1
等 级:新手上路
帖 子:139
专家分:0
注 册:2005-6-20
收藏
得分:0 
一页面上有这样一段代码,去掉后才能使用左键选择copy
怎么这么费劲啊?
2006-05-15 17:54
快速回复:是它屏蔽了左键吗?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.042228 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved