⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showclass_menu01.js

📁 已经消失的不易找到的C++ builder网络教程总结
💻 JS
📖 第 1 页 / 共 4 页
字号:
document.writeln("<html>");
document.writeln("");
document.writeln("<head>");
document.writeln("<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\">");
document.writeln("<title>网页特效代码|JsCode.CN|---非常棒的绿色下拉透明菜单<\/title>");
document.writeln("");
document.writeln("<style type=\"text\/css\">");
document.writeln("<!--");
document.writeln("body {");
document.writeln("	margin-left: 0px;");
document.writeln("	margin-top: 0px;");
document.writeln("	margin-right: 0px;");
document.writeln("	margin-bottom: 0px;");
document.writeln("}");
document.writeln("-->");
document.writeln("<\/style><\/head>");
document.writeln("");
document.writeln("<body>");
document.writeln("");
document.writeln("<script language=\"JavaScript\">");
document.writeln("var mmenus    = new Array();");
document.writeln("var misShow   = new Boolean(); ");
document.writeln("misShow=false;");
document.writeln("var misdown   = new Boolean();");
document.writeln("misdown=false;");
document.writeln("var mnumberofsub=0;");
document.writeln("var musestatus=false;");
document.writeln("var mpopTimer = 0;");
document.writeln("mmenucolor=\'#f3f2f7\';mfontcolor=\'000000\';mmenuoutcolor=\'#A5CEEF\';mmenuincolor=\'#f3f2f7\';mmenuoutbordercolor=\'#cccccc\';mmenuinbordercolor=\'#cccccc\';mmidoutcolor=\'#0066FF\';mmidincolor=\'#000000\';mmenuovercolor=\'#ff0000\';mitemedge=\'0\';msubedge=\'1\';mmenuunitwidth=55;mmenuitemwidth=77;mmenuheight=30;mmenuwidth=\'950\';mmenuadjust=0;mmenuadjustV=0;mfonts=\'font-family: 宋体; font-size: 10pt; color: #000000; \';mcursor=\'hand\';");
document.writeln("var swipeSteps = 4;");
document.writeln("var swipemsec = 25;");
document.writeln("var swipeArray = new Array();");
document.writeln("function swipe(el, dir, steps, msec) {");
document.writeln("	if (steps == null) steps = swipeSteps;");
document.writeln("	if (msec == null) msec = swipemsec;");
document.writeln("	if (el.swipeIndex == null)");
document.writeln("		el.swipeIndex = swipeArray.length;");
document.writeln("	if (el.swipeTimer != null)");
document.writeln("		window.clearTimeout(el.swipeTimer);");
document.writeln("	swipeArray[el.swipeIndex] = el;");
document.writeln("	el.style.clip = \"rect(-99999, 99999, 99999, -99999)\";");
document.writeln("	if (el.swipeCounter == null || el.swipeCounter == 0) {");
document.writeln("		el.orgLeft  = el.offsetLeft;");
document.writeln("		el.orgTop  = el.offsetTop;");
document.writeln("		el.orgWidth = el.offsetWidth;");
document.writeln("		el.orgHeight  = el.offsetHeight;");
document.writeln("	}");
document.writeln("	el.swipeCounter = steps;");
document.writeln("	el.style.clip = \"rect(0,0,0,0)\";");
document.writeln("	window.setTimeout(\"repeat(\" + dir + \",\" + el.swipeIndex + \",\" + steps + \",\" + msec + \")\", msec);");
document.writeln("}");
document.writeln("function repeat(dir, index, steps, msec) {");
document.writeln("	el = swipeArray[index];");
document.writeln("	var left   = el.orgLeft;");
document.writeln("	var top    = el.orgTop;");
document.writeln("	var width  = el.orgWidth;");
document.writeln("	var height = el.orgHeight;");
document.writeln("	if (el.swipeCounter == 0) {");
document.writeln("		el.style.clip = \"rect(-99999, 99999, 99999, -99999)\";");
document.writeln("		return;");
document.writeln("	}");
document.writeln("	else {");
document.writeln("		el.swipeCounter--;");
document.writeln("		el.style.visibility = \"visible\";");
document.writeln("		switch (dir) {");
document.writeln("			case 2:");
document.writeln("				el.style.clip = \"rect(\" + height*el.swipeCounter\/steps + \",\" + width + \",\" + height + \",\" + 0 + \")\";");
document.writeln("				el.style.top  = top - height*el.swipeCounter\/steps;");
document.writeln("				break;");
document.writeln("			case 8:");
document.writeln("				el.style.clip = \"rect(\" + 0 + \",\" + width + \",\" + height*(steps-el.swipeCounter)\/steps + \",\" + 0 + \")\";");
document.writeln("				el.style.top  = top + height*el.swipeCounter\/steps;");
document.writeln("				break;");
document.writeln("			case 6:");
document.writeln("				el.style.clip = \"rect(\" + 0 + \",\" + width + \",\" + height + \",\" + width*(el.swipeCounter)\/steps + \")\";");
document.writeln("				el.style.left  = left - width*el.swipeCounter\/steps;");
document.writeln("				break;");
document.writeln("			case 4:");
document.writeln("				el.style.clip = \"rect(\" + 0 + \",\" + width*(swipeSteps - el.swipeCounter)\/steps + \",\" + height + \",\" + 0 + \")\";");
document.writeln("				el.style.left  = left + width*el.swipeCounter\/steps;");
document.writeln("				break;");
document.writeln("		}");
document.writeln("		");
document.writeln("		el.swipeTimer = window.setTimeout(\"repeat(\" + dir + \",\" + index + \",\" + steps + \",\" + msec + \")\", msec);");
document.writeln("	}");
document.writeln("}");
document.writeln("var mtmpleft=\"\";");
document.writeln("var mtmptop=\"\";");
document.writeln("function hideSwipe(el) {");
document.writeln("	window.clearTimeout(el.swipeTimer);");
document.writeln("	el.style.visibility = \"hidden\";");
document.writeln("	el.style.clip = \"rect(-99999, 99999, 99999, -99999)\";");
document.writeln("	el.swipeCounter = 0;");
document.writeln("	if(mtmpleft!=\"\")el.style.left = mtmpleft;");
document.writeln("	if(mtmptop!=\"\")el.style.top = mtmptop;");
document.writeln("}");
document.writeln("");
document.writeln("function stoperror(){");
document.writeln("return true;");
document.writeln("}");
document.writeln("window.onerror=stoperror;");
document.writeln("function mpopOut() {");
document.writeln("mpopTimer = setTimeout(\'mallhide()\', 500);");
document.writeln("}");
document.writeln("function getReal(el, type, value) {");
document.writeln("	temp = el;");
document.writeln("	while ((temp != null) && (temp.tagName != \"BODY\")) {");
document.writeln("		if (eval(\"temp.\" + type) == value) {");
document.writeln("			el = temp;");
document.writeln("			return el;");
document.writeln("		}");
document.writeln("		temp = temp.parentElement;");
document.writeln("	}");
document.writeln("	return el;");
document.writeln("}");
document.writeln("");
document.writeln("");
document.writeln("function mMenuRegister(menu) ");
document.writeln("{");
document.writeln("  mmenus[mmenus.length] = menu");
document.writeln("  return (mmenus.length - 1)");
document.writeln("}");
document.writeln("");
document.writeln("function mMenuItem(caption,command,target,isline,statustxt,level,img,sizex,sizey,pos){");
document.writeln("	this.items = new Array();");
document.writeln("	this.caption=caption;");
document.writeln("	this.command=command;");
document.writeln("	this.target=target;");
document.writeln("	this.isline=isline;");
document.writeln("	this.statustxt=statustxt;");
document.writeln("	if(level!=null){mnumberofsub++;");
document.writeln("	this.hasc=mnumberofsub;}");
document.writeln("	this.level=level;");
document.writeln("	this.img=img;");
document.writeln("	this.sizex=sizex;");
document.writeln("	this.sizey=sizey;");
document.writeln("	this.pos=pos;");
document.writeln("}");
document.writeln("");
document.writeln("function mMenu(caption,command,target,img,sizex,sizey,pos){");
document.writeln("	this.items = new Array();");
document.writeln("	this.caption=caption;");
document.writeln("	this.command=command;");
document.writeln("	this.target=target;");
document.writeln("	this.img=img;");
document.writeln("	this.sizex=sizex;");
document.writeln("	this.sizey=sizey;");
document.writeln("	this.pos=pos;");
document.writeln("	this.id=mMenuRegister(this);");
document.writeln("}");
document.writeln("function mMenuAddItem(item)");
document.writeln("{");
document.writeln("  this.items[this.items.length] = item");
document.writeln("  item.parent = this.id;");
document.writeln("  this.children=true;");
document.writeln("}");
document.writeln("");
document.writeln("mMenu.prototype.addItem = mMenuAddItem;");
document.writeln("mMenuItem.prototype.addsubItem = mMenuAddItem;");
document.writeln("");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -