| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2057 人关注过本帖
标题:怎么去掉鼠标拖动的效果?
只看楼主 加入收藏
没有人
Rank: 1
等 级:新手上路
帖 子:136
专家分:0
注 册:2006-2-16
收藏
 问题点数:0 回复次数:5 
怎么去掉鼠标拖动的效果?
我在网上找了个QQ客服的代码,带拖动效果,我看不懂这些代码,找了半天也没找到,急死我了,请求好新人帮忙看看,谢谢了

document.writeln("<!--随屏移动图片代码-->");
document.writeln("<style type=\"text\/css\">");
document.writeln("<!-- ");
document.writeln("body{font-size=9pt}");
document.writeln("TH{FONT-SIZE: 9pt}");
document.writeln("TD{ FONT-SIZE: 9pt}");
document.writeln("#floater {");
document.writeln("position: absolute;");
document.writeln("left: 900px;");
document.writeln("top: 600;");
document.writeln("width: 72;");
document.writeln("visibility: visible;");
document.writeln("z-index: 10;");
document.writeln("}");
document.writeln("-->");
document.writeln("<\/style>");
document.writeln("");
document.writeln("");
document.writeln("<script>");
document.writeln("var online= new Array();");
document.writeln("if (!document.layers)");
document.writeln("document.write(\'<div id=\"divStayTopLeft\" style=\"position:absolute\">\')");
document.writeln("<\/script>");
document.writeln("<!--随屏移动图片代码-->");
document.writeln("");
document.writeln("");
document.writeln("<div ID=\"floater\" style=\"right: 2px; top: 350px\"> ");
document.writeln("");
document.writeln("<TABLE cellSpacing=0 cellPadding=0 width=72 align=center border=0 id=\"table2\">");
document.writeln("  <TBODY>");
document.writeln("  <TR>");
document.writeln("    <TD>");
document.writeln(" <IMG ");
document.writeln("      src=\"http:\/\/www.\/img\/q1.jpg\" ");
document.writeln("      useMap=#m_about02Map border=0><\/TD><\/TR><\/TBODY><\/TABLE>");
document.writeln("");
document.writeln("<DIV id=tracq1>");
document.writeln("");
document.writeln("<TABLE cellSpacing=0 cellPadding=0 width=72 align=center border=0 id=\"table3\">");
document.writeln("  <TBODY>");
document.writeln("  <TR>");
document.writeln("    <TD class=cpx12hei vAlign=center align=middle width=72 ");
document.writeln("    background=\"http:\/\/www.\/img\/q2.jpg\" ");
document.writeln("    >");
document.writeln("");
document.writeln("      <TABLE cellSpacing=0 cellPadding=0 width=\"72\" border=0 id=\"table5\">");
document.writeln("        <TBODY>");
document.writeln("        <TR>");
document.writeln("          <TD height=5>");
document.writeln("<SPAN id=ad_01>载入中...<\/SPAN>");
document.writeln("");
document.writeln("<\/TD><\/TR><\/TBODY><\/TABLE>");
document.writeln("     ");
document.writeln("");
document.writeln("    <\/TD><\/TR>");
document.writeln("  <TR>");
document.writeln("    <TD>");
document.writeln("<IMG height=21 ");
document.writeln("      src=\"http:\/\/www.\/img\/q3.jpg\" ");
document.writeln("      width=72 align=center border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><\/DIV><\/DIV><\/DIV>");
document.writeln("<p> ");
document.writeln("  <script LANGUAGE=\"JavaScript\">");
document.writeln("self.onError=null;");
document.writeln("currentX = currentY = 0;");
document.writeln("whichIt = null;");
document.writeln("lastScrollX = 0; lastScrollY = 0;");
document.writeln("NS = (document.layers) ? 1 : 0;");
document.writeln("IE = (document.all) ? 1: 0;");
document.writeln("<!-- STALKER CODE -->");
document.writeln("function heartBeat() {");
document.writeln("if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }");
document.writeln("if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }");
document.writeln("if(diffY != lastScrollY) {");
document.writeln("percent = .1 * (diffY - lastScrollY);");
document.writeln("if(percent > 0) percent = Math.ceil(percent);");
document.writeln("else percent = Math.floor(percent);");
document.writeln("if(IE) document.all.floater.style.pixelTop += percent;");
document.writeln("if(NS) document.floater.top += percent;");
document.writeln("lastScrollY = lastScrollY + percent;");
document.writeln("}");
document.writeln("if(diffX != lastScrollX) {");
document.writeln("percent = .1 * (diffX - lastScrollX);");
document.writeln("if(percent > 0) percent = Math.ceil(percent);");
document.writeln("else percent = Math.floor(percent);");
document.writeln("if(IE) document.all.floater.style.pixelLeft += percent;");
document.writeln("if(NS) document.floater.left += percent;");
document.writeln("lastScrollX = lastScrollX + percent;");
document.writeln("}");
document.writeln("}");
document.writeln("<!-- \/STALKER CODE -->");
document.writeln("<!-- DRAG DROP CODE -->");
document.writeln("function checkFocus(x,y) {");
document.writeln("stalkerx = document.floater.pageX;");
document.writeln("stalkery = document.floater.pageY;");
document.writeln("stalkerwidth = document.floater.clip.width;");
document.writeln("stalkerheight = document.floater.clip.height;");
document.writeln("if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;");
document.writeln("else return false;");
document.writeln("}");
document.writeln("function grabIt(e) {");
document.writeln("if(IE) {");
document.writeln("whichIt = event.srcElement;");
document.writeln("while (whichIt.id.indexOf(\"floater\") == -1) {");
document.writeln("whichIt = whichIt.parentElement;");
document.writeln("if (whichIt == null) { return true; }");
document.writeln("}");
document.writeln("whichIt.style.pixelLeft = whichIt.offsetLeft;");
document.writeln("whichIt.style.pixelTop = whichIt.offsetTop;");
document.writeln("currentX = (event.clientX + document.body.scrollLeft);");
document.writeln("currentY = (event.clientY + document.body.scrollTop);");
document.writeln("} else {");
document.writeln("window.captureEvents(Event.MOUSEMOVE);");
document.writeln("if(checkFocus (e.pageX,e.pageY)) {");
document.writeln("");
document.writeln("whichIt = document.floater;");
document.writeln("StalkerTouchedX = e.pageX-document.floater.pageX;");
document.writeln("StalkerTouchedY = e.pageY-document.floater.pageY;");
document.writeln("}");
document.writeln("}");
document.writeln("return true;");
document.writeln("}");
document.writeln("function moveIt(e) {");
document.writeln("if (whichIt == null) { return false; }");
document.writeln("if(IE) {");
document.writeln("newX = (event.clientX + document.body.scrollLeft);");
document.writeln("newY = (event.clientY + document.body.scrollTop);");
document.writeln("distanceX = (newX - currentX); distanceY = (newY - currentY);");
document.writeln("currentX = newX; currentY = newY;");
document.writeln("whichIt.style.pixelLeft += distanceX;");
document.writeln("whichIt.style.pixelTop += distanceY;");
document.writeln("if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;");
document.writeln("if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;");
document.writeln("if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;");
document.writeln("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;");
document.writeln("event.returnValue = false;");
document.writeln("} else {");
document.writeln("whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);");
document.writeln("if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;");
document.writeln("if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;");
document.writeln("if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;");
document.writeln("if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;");
document.writeln("return false;");
document.writeln("}");
document.writeln("return false;");
document.writeln("}");
document.writeln("function dropIt() {");
document.writeln("whichIt = null;");
document.writeln("if(NS) window.releaseEvents (Event.MOUSEMOVE);");
document.writeln("return true;");
document.writeln("}");
document.writeln("<!-- DRAG DROP CODE -->");
document.writeln("if(NS) {");
document.writeln("window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);");
document.writeln("window.onmousedown = grabIt;");
document.writeln("window.onmousemove = moveIt;");
document.writeln("window.onmouseup = dropIt;");
document.writeln("}");
document.writeln("if(IE) {");
document.writeln("");
document.writeln("document.onmousedown = grabIt;");
document.writeln("document.onmousemove = moveIt;");
document.writeln("document.onmouseup = dropIt;");
document.writeln("}");
document.writeln("if(NS || IE) action = window.setInterval(\"heartBeat()\",1);");
document.writeln("<\/script>");
document.writeln("  <!--随屏移动图片代码结束-->");


上面的红色部分是随屏移动的和拖动的代码,我想去掉拖动的代码,保留随屏移动的代码。
搜索更多相关主题的帖子: quot document writeln 拖动 鼠标 
2007-11-26 18:08
mycxsky110
Rank: 1
来 自:屠宰场
等 级:新手上路
帖 子:42
专家分:0
注 册:2007-11-19
收藏
得分:0 
你的代码可以运行么,我复制下来都不可以运行?

上善若水,水善利万物而不争,处众人之所恶,故几于道。
2007-11-26 19:07
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
如果只是生成qq在线状态,可以点击自己的qq,进入个人设置,点击下方的qq生成代码,然后复制代码,就可以用了。
2007-11-26 21:22
没有人
Rank: 1
等 级:新手上路
帖 子:136
专家分:0
注 册:2006-2-16
收藏
得分:0 
生成在线QQ状态我知道,但我现在想要一个可以随屏幕移动的QQ客服,上面这个是我在网上找的,可以正常运行,但我只把QQ.JS贴出来勒,还有一段代码没贴出来,所以可能运行不了。

有知道的朋友帮忙解答一下吗?我应该删除哪段代码才能去除拖动效果?或者有人有更好点的在线移动QQ的代码吗??????急

让压力来的更猛些..
2007-11-27 09:35
sinolbs
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-3-21
收藏
得分:0 
我们也有一个这样的代码
你也一样,就是不知道怎么回事,我也看不明白里面的容易!
有高手就出来支持一下吧!
2008-03-21 21:12
叶飘
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2008-3-18
收藏
得分:0 
去除这些语句
document.writeln("window.captureEvents(Event.MOUSEMOVE);");
document.writeln("if(checkFocus (e.pageX,e.pageY)) {");
document.writeln("");
document.writeln("whichIt = document.floater;");
document.writeln("StalkerTouchedX = e.pageX-document.floater.pageX;");
document.writeln("StalkerTouchedY = e.pageY-document.floater.pageY;");
document.writeln("}");
document.writeln("}");
document.writeln("return true;");
document.writeln("}");
2008-04-09 17:51
快速回复:怎么去掉鼠标拖动的效果?
数据加载中...
 
   



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

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