求js这段代码
发布网友
发布时间:2022-04-24 13:20
我来回答
共2个回答
热心网友
时间:2022-04-24 14:50
////////////////////////////////////////////////guang gao
document.writeln("<script language=Jscript>");
document.writeln("<!--");
document.writeln("var x0=0,y0=0,x1=0,y1=0;");
document.writeln("var offx=6,offy=6;");
document.writeln("var moveable=false;");
document.writeln("var hover=\'red\',normal=\'slategray\';\/\/color;");
document.writeln("var index=10000;\/\/z-index;");
document.writeln("\/\/开始拖动;");
document.writeln("function startDrag(obj)");
document.writeln("{");
document.writeln(" if(event.button==1)");
document.writeln(" {");
document.writeln(" \/\/锁定标题栏;");
document.writeln(" obj.setCapture();");
document.writeln(" \/\/定义对象;");
document.writeln(" var win = obj.parentNode;");
document.writeln(" var sha = win.nextSibling;");
document.writeln(" \/\/记录鼠标和层位置;");
document.writeln(" x0 = event.clientX;");
document.writeln(" y0 = event.clientY;");
document.writeln(" x1 = parseInt(win.style.left);");
document.writeln(" y1 = parseInt(win.style.top);");
document.writeln(" \/\/记录颜色;");
document.writeln(" normal = obj.style.backgroundColor;");
document.writeln(" \/\/改变风格;");
document.writeln(" obj.style.backgroundColor = hover;");
document.writeln(" win.style.borderColor = hover;");
document.writeln(" obj.nextSibling.style.color = hover;");
document.writeln(" sha.style.left = x1 + offx;");
document.writeln(" sha.style.top = y1 + offy;");
document.writeln(" moveable = true;");
document.writeln(" }");
document.writeln("}");
document.writeln("\/\/拖动;");
document.writeln("function drag(obj)");
document.writeln("{");
document.writeln(" if(moveable)");
document.writeln(" {");
document.writeln(" var win = obj.parentNode;");
document.writeln(" var sha = win.nextSibling;");
document.writeln(" win.style.left = x1 + event.clientX - x0;");
document.writeln(" win.style.top = y1 + event.clientY - y0;");
document.writeln(" sha.style.left = parseInt(win.style.left) + offx;");
document.writeln(" sha.style.top = parseInt(win.style.top) + offy;");
document.writeln(" }");
document.writeln("}");
document.writeln("\/\/停止拖动;");
document.writeln("function stopDrag(obj)");
document.writeln("{");
document.writeln(" if(moveable)");
document.writeln(" {");
document.writeln(" var win = obj.parentNode;");
document.writeln(" var sha = win.nextSibling;");
document.writeln(" var msg = obj.nextSibling;");
document.writeln(" win.style.borderColor = normal;");
document.writeln(" obj.style.backgroundColor = normal;");
document.writeln(" msg.style.color = normal;");
document.writeln(" sha.style.left = obj.parentNode.style.left;");
document.writeln(" sha.style.top = obj.parentNode.style.top;");
document.writeln(" obj.releaseCapture();");
document.writeln(" moveable = false;");
document.writeln(" }");
document.writeln("}");
document.writeln("\/\/获得焦点;");
document.writeln("function getFocus(obj)");
document.writeln("{");
document.writeln(" if(obj.style.zIndex!=index)");
document.writeln(" {");
document.writeln(" index = index + 2;");
document.writeln(" var idx = index;");
document.writeln(" obj.style.zIndex=idx;");
document.writeln(" obj.nextSibling.style.zIndex=idx-1;");
document.writeln(" }");
document.writeln("}");
document.writeln("\/\/最小化;");
document.writeln("function min(obj)");
document.writeln("{");
document.writeln(" var win = obj.parentNode.parentNode;");
document.writeln(" var sha = win.nextSibling;");
document.writeln(" var tit = obj.parentNode;");
document.writeln(" var msg = tit.nextSibling;");
document.writeln(" var flg = msg.style.display==\"none\";");
document.writeln(" if(flg)");
document.writeln(" {");
document.writeln(" win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2;");
document.writeln(" sha.style.height = win.style.height;");
document.writeln(" msg.style.display = \"block\";");
document.writeln(" obj.innerHTML = \"0\";");
document.writeln(" }");
document.writeln(" else");
document.writeln(" {");
document.writeln(" win.style.height = parseInt(tit.style.height) + 2*2;");
document.writeln(" sha.style.height = win.style.height;");
document.writeln(" obj.innerHTML = \"2\";");
document.writeln(" msg.style.display = \"none\";");
document.writeln(" }");
document.writeln("}");
document.writeln("\/\/关闭;");
document.writeln("function cls(obj)");
document.writeln("{");
document.writeln(" var win = obj.parentNode.parentNode;");
document.writeln(" var sha = win.nextSibling;");
document.writeln(" win.style.visibility = \"hidden\";");
document.writeln(" sha.style.visibility = \"hidden\";");
document.writeln("}");
document.writeln("\/\/创建一个对象;");
document.writeln("function xWin(id,w,h,l,t,tit,msg)");
document.writeln("{");
document.writeln(" index = index+2;");
document.writeln(" this.id = id;");
document.writeln(" this.width = w;");
document.writeln(" this.height = h;");
document.writeln(" this.left = l;");
document.writeln(" this.top = t;");
document.writeln(" this.zIndex = index;");
document.writeln(" this.title = tit;");
document.writeln(" this.message = msg;");
document.writeln(" this.obj = null;");
document.writeln(" this.bulid = bulid;");
document.writeln(" this.bulid();");
document.writeln("}");
document.writeln("\/\/初始化;");
document.writeln("function bulid()");
document.writeln("{");
document.writeln(" var str = \"\"");
document.writeln(" + \"<div id=xMsg\" + this.id + \" \"");
document.writeln(" + \"style=\'\"");
document.writeln(" + \"z-index:\" + this.zIndex + \";\"");
document.writeln(" + \"width:\" + this.width + \";\"");
document.writeln(" + \"height:\" + this.height + \";\"");
document.writeln(" + \"left:\" + this.left + \";\"");
document.writeln(" + \"top:\" + this.top + \";\"");
document.writeln(" + \"background-color:\" + normal + \";\"");
document.writeln(" + \"color:\" + normal + \";\"");
document.writeln(" + \"font-size:12px;\"");
document.writeln(" + \"font-family:Verdana;\"");
document.writeln(" + \"position:absolute;\"");
document.writeln(" + \"cursor:default;\"");
document.writeln(" + \"border:2px solid \" + normal + \";\"");
document.writeln(" + \"\' \"");
document.writeln(" + \"onmousedown=\'getFocus(this)\'>\"");
document.writeln(" + \"<div \"");
document.writeln(" + \"style=\'\"");
document.writeln(" + \"background-color:\" + normal + \";\"");
document.writeln(" + \"width:\" + (this.width-2*2) + \";\"");
document.writeln(" + \"height:20;\"");
document.writeln(" + \"color:#ebf1ff;\"");
document.writeln(" + \"\' \"");
document.writeln(" + \"onmousedown=\'startDrag(this)\' \"");
document.writeln(" + \"onmouseup=\'stopDrag(this)\' \"");
document.writeln(" + \"onmousemove=\'drag(this)\' \"");
document.writeln(" + \"ondblclick=\'min(this.childNodes[1])\'\"");
document.writeln(" + \">\"");
document.writeln(" + \"<span style=\'width:\" + (this.width-2*12-4) + \";padding-left:3px;\'>\" + this.title + \"<\/span>\"");
document.writeln(" + \"<span style=\'width:12;border-width:0px;color:#ebf1ff;font-family:webdings;\' onclick=\'min(this)\'>0<\/span>\"");
document.writeln(" + \"<span style=\'width:12;border-width:0px;color:#ebf1ff;font-family:webdings;\' onclick=\'cls(this)\'>r<\/span>\"");
document.writeln(" + \"<\/div>\"");
document.writeln(" + \"<div style=\'\"");
document.writeln(" + \"width:100%;\"");
document.writeln(" + \"height:\" + (this.height-20-4) + \";\"");
document.writeln(" + \"background-color:#ebf1ff;\"");
document.writeln(" + \"line-height:16px;\"");
document.writeln(" + \"word-break:break-all;\"");
document.writeln(" + \"padding:3px;\"");
document.writeln(" + \"\'>\" + this.message + \"<\/div>\"");
document.writeln(" + \"<\/div>\"");
document.writeln(" + \"<div style=\'\"");
document.writeln(" + \"width:\" + this.width + \";\"");
document.writeln(" + \"height:\" + this.height + \";\"");
document.writeln(" + \"top:\" + this.top + \";\"");
document.writeln(" + \"left:\" + this.left + \";\"");
document.writeln(" + \"z-index:\" + (this.zIndex-1) + \";\"");
document.writeln(" + \"position:absolute;\"");
document.writeln(" + \"background-color:black;\"");
document.writeln(" + \"filter:alpha(opacity=40);\"");
document.writeln(" + \"\'>by wildwind<\/div>\";");
document.writeln(" document.body.insertAdjacentHTML(\"beforeEnd\",str);");
document.writeln("}");
document.writeln("\/\/-->");
document.writeln("<\/script>");
document.writeln("<script language=\'Jscript\'>");
document.writeln("<!--");
document.writeln("function initialize()");
document.writeln("{");
document.writeln(" var b = new xWin(\"2\",250,200,545,200,\"公告\",\"<a href=http:\/\/www.cx99w.com\/E%20pan/yuyi888\/jian%20jie.html target=_blank>业务简介<\/a><br><a href=http:\/\/www.cx99w.com\/E%20pan\/index.html target=_blank>特效代码<\/a><br>热烈庆祝本站2008年9月6日再次被百度收录(关键词:E盘天王)<br><br>本站7月31晚新推出E盘功能区特效(功能区可隐藏,只要点下特殊开关就可立即显示。让你再也不用到后台修改代码了),有需要的联系我们。欢迎前来定作。<br>我站营业时间:星期一至星期六(每天晚上9点30分至2点)星期天24小时营业。\");");
document.writeln("}");
document.writeln("window.onload = initialize;");
document.writeln("\/\/-->");
document.writeln("<\/script>")
热心网友
时间:2022-04-24 16:08
有病毒