LOGO 首页 OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 技术文档 其他文档  
 
网站管理员

不可或缺的脚本代码

admin
2010年4月27日 3:4 本文热度 10210
[p]一、一些很实用且必用的小脚本代码:[/p] [p]脚本1:进入主页以后自动播放声音 [/p] [p][/p] [p]脚本2:进入主页后自动最大话,省的去在自己单击了[/p] [p] [/p] [p][br]以下为引用的内容:[br]<script>[br]self.moveto(0,0)[br]self.resizeto(screen.availwidth,screen.availheight)[br]</script> [/p] [p] [/p] [p]脚本3:显示现在时间的脚本 [/p] [p]<script language=vbscript>document.write now</script> [/p] [p]脚本4:显示最后修改时间的脚本[/p] [p] [/p] [p]<script>document.write(document.lastmodified)</script>[/p] [p] [/p] [p]脚本5:设为首页,加为收藏,加入频道,启动outlook发信[/p] [p] [/p] [p]以下为引用的内容:[br]”>设为首页 [/p] [p]加入收藏 [/p] [p]加入频道[/p] [p] [/p] [p]与我联系[/p] [p] [/p] [p]脚本6:状态栏动态显示现在时间 [/p] [p]以下为引用的内容:[br]<script>[br]function see(){[br]window.settimeout(”see()”,1000);[br]today = new date();[br]self.status = today.tostring();[br]}[br]</script>[br] [/p] [p] [/p] [p]脚本7:关闭窗口的脚本 [/p] [p][关闭窗口] [/p] [p]脚本8:按下f12键,直接返回首页[/p] [p] [/p] [p]以下为引用的内容:[br]<script>function look(){[br]if(event.keycode==123){document.location.href=http://10.13.31.90/~kayvin/}[br]}[br]if(document.onkeydown==null)[br]{document.onkeydown=look}[br]</script> [/p] [p] [/p] [p]脚本9:后退,刷新,前进 [/p] [p]以下为引用的内容:[br] [/p] [p][/p] [p] [br] [/p] [p] [/p] [p]脚本10:设定时间弹出窗口,4000=4秒,当然你可以自定义 [/p] [p]以下为引用的内容:[br]<script>function l()[br]{[br]window.open(” 10.13.31.90/~kayvin/ “,”name”,”width=500,height=150,border=0″)[br]}[br]settimeout(”l()”,4000) [/p] [p]</script> [br] [/p] [p] [/p] [p]脚本11:鼠标旁边的提示信息,类似与163登录后的页面提示效果[/p] [p]以下为引用的内容:[br]tip[br]<script language=”javascript”>[br]//***********默认设置定义.*********************[br]tpopwait=50;//停留twait豪秒后显示提示。[br]tpopshow=5000;//显示tshow豪秒后关闭提示[br]showpopstep=20;[br]popopacity=99;[br]//***************内部变量定义*****************[br]spop=null;[br]curshow=null;[br]tfadeout=null;[br]tfadein=null;[br]tfadewaiting=null;[br]document.write(””);[br]document.write(”
”);[br]function showpopuptext(){[br]var o=event.srcelement;[br]mousex=event.x;[br]mousey=event.y;[br]if(o.alt!=null && o.alt!=”"){o.dypop=o.alt;o.alt=”"};[br]if(o.title!=null && o.title!=”"){o.dypop=o.title;o.title=”"};[br]if(o.dypop!=spop) {[br]spop=o.dypop;[br]cleartimeout(curshow);[br]cleartimeout(tfadeout);[br]cleartimeout(tfadein);[br]cleartimeout(tfadewaiting);[/p] [p]if(spop==null || spop==”") {[br]dypoplayer.innerhtml=”";[br]dypoplayer.style.filter=”alpha()”;[br]dypoplayer.filters.alpha.opacity=0;[br]}[br]else {[br]if(o.dyclass!=null) popstyle=o.dyclass[br]else popstyle=”cpoptext”;[br]curshow=settimeout(”showit()”,tpopwait);[br]}[br]}[br]}[br]function showit(){[br]dypoplayer.classname=popstyle;[br]dypoplayer.innerhtml=spop;[br]popwidth=dypoplayer.clientwidth;[br]popheight=dypoplayer.clientheight;[br]if(mousex+12+popwidth>document.body.clientwidth) popleftadjust=-popwidth-24[br]else popleftadjust=0;[br]if(mousey+12+popheight>document.body.clientheight) poptopadjust=-popheight-24[br]else poptopadjust=0;[br]dypoplayer.style.left=mousex+12+document.body.scrollleft+popleftadjust;[br]dypoplayer.style.top=mousey+12+document.body.scrolltop+poptopadjust; [br]dypoplayer.style.filter=”alpha(opacity=0)”;[br]fadeout();[br]}[br]function fadeout(){[br]if(dypoplayer.filters.alpha.opacity0) {[br]dypoplayer.filters.alpha.opacity-=1;[br]tfadein=settimeout(”fadein()”,1);[br]}[br]}[br]document.onmouseover=showpopuptext;[br]</script> [br] [/p] [p]脚本12:如果文字过长,则将过长的部分变成省略号显示[/p] [p]以下为引用的内容:[br]
[br]就是比如有一行文字,很长,表格内一行显示不下.[br]
[/p] [p][br]脚本13:滚动的图片[/p] [p]以下为引用的内容:[br]<script language=”javascript”>[br]imgarr=new array()[br]imgarr[0]=””[br]imgarr[1]=””[br]imgarr[2]=”” [/p] [p]imgarr[3]=””[br]imgarr[4]=””[br]var movestep=4 //步长,单位:pixel[br]var moverelax=100 //移动时间间隔,单位:ms[br]ns4=(document.layers)?true:false[br]var displayimgamount=4 //视区窗口可显示个数[br]var divwidth=220 //每块图片占位宽[br]var divheight=145 //每块图片占位高[br]var startdnum=0[br]var nextdnum=startdnum+displayimgamount[br]var timeid[br]var outhover=false[br]var startdivclipleft[br]var nextdivclipright [br]function initdivplace(){[br]if (ns4){[br]for (i=0;idivwidth){[br]eval(”document.divouter.document.divads”+nextdnum+”.clip.right=”+divwidth)[/p] [p]eval(”document.divouter.document.divads”+startdnum+”.left=”+divwidth*displayimgamount)[br]eval(”document.divouter.document.divads”+parseint((nextdnum+1)%imgarr.length)+”.left=document.divouter.document.divads”+nextdnum+”.left+”+divwidth)[br]eval(”document.divouter.document.divads”+parseint((nextdnum+1)%imgarr.length)+”.clip.left=0″) [/p] [p]startdnum=(++startdnum)%imgarr.length[br]nextdnum=(startdnum+displayimgamount)%imgarr.length[/p] [p]startdivclipleft=movestep-(divwidth-startdivclipleft)[br]nextdivclipright=movestep-(divwidth-nextdivclipright)[br]}else{[br]eval(”document.divouter.document.divads”+nextdnum+”.clip.left=0″)[br]startdivclipleft+=movestep [br]nextdivclipright+=movestep[br]}[br]eval(”document.divouter.document.divads”+startdnum+”.clip.left=”+startdivclipleft)[br]eval(”document.divouter.document.divads”+nextdnum+”.clip.right=”+nextdivclipright)[br]}else{[br]for (i=0;i<=displayimgamount;i++){[br]eval(”document.all.divads”+parseint((startdnum+i)%imgarr.length)+”.style.left=document.all.divads”+parseint((startdnum+i)%imgarr.length)+”.style.pixelleft-movestep”)[br]}[/p] [p]startdivclipleft=parseint(eval(”document.all.divads”+startdnum+”.currentstyle.clipleft”)) [br]nextdivclipright=parseint(eval(”document.all.divads”+nextdnum+”.currentstyle.clipright”))[/p] [p]if (startdivclipleft+movestep>divwidth){[br]eval(”document.all.divads”+nextdnum+”.style.clip=’rect(0,”+divwidth+”,”+divheight+”,0″+”)’”)[/p] [p]eval(”document.all.divads”+startdnum+”.style.left=”+divwidth*displayimgamount)[br]eval(”document.all.divads”+parseint((nextdnum+1)%imgarr.length)+”.style.left=document.all.divads”+nextdnum+”.style.pixelleft+”+divwidth)[/p] [p] [/p] [p]startdnum=(++startdnum)%imgarr.length[br]nextdnum=(startdnum+displayimgamount)%imgarr.length[/p] [p]startdivclipleft=movestep-(divwidth-startdivclipleft)[br]nextdivclipright=movestep-(divwidth-nextdivclipright)[br]}else{[br]startdivclipleft+=movestep[br]nextdivclipright+=movestep[br]}[br]eval(”document.all.divads”+startdnum+”.style.clip=’rect(0,”+divwidth+”,”+divheight+”,”+startdivclipleft+”)’”)[/p] [p] [/p] [p]eval(”document.all.divads”+nextdnum+”.style.clip=’rect(0,”+nextdivclipright+”,”+divheight+”,0)’”)[br]}[br]if (outhover){[br]mvstop()[br]}else{[br]mvstart()[br]}[/p] [p]}[br]function writedivs(){[br]if (ns4){[br]document.write(””)[/p] [p]for (i=0;i”)[br]document.write(imgarr[i]+” “)[/p] [p] [/p] [p]document.write(””)[br]}[br]document.write(””)[br]document.close()[br]for (i=displayimgamount;i”)[/p] [p]for (i=0;i”)[br]document.write(imgarr[i]+” “)[br]document.write(”
”)[br]}[br]document.write(”
”)[br]for (i=displayimgamount;i[br]<script language=javascript>writedivs();initdivplace();</script>[/p] [p] [/p] [p]脚本14:接收键盘指令的脚本 [/p] [p]按a就会跳转到地图名片的网页,请按a[/p] [p]以下为引用的内容:[br]<script language=”javascript”>[br][br][br][br] new document [br][br][br][br][br] [/p] [p][br]<script language=”javascript” type=”text/javascript”> [br]startcolor = “#671700″; // 定义链接颜色[br]endcolor = “#d8d1c5″; // 定义要渐变到最后的颜色 [/p] [p]stepin = 17;[br]stepout = 23;[/p] [p][br]/*[br]定义是否让所有的文本链接自动渐变,true为是,false为否[br]*/[br]autofade = true;[/p] [p] [/p] [p]/*[br]在这里定义css样式里的类class:fade,如果为true,那么你要将要渐变的链接上加上此fade样式[br]*/[br]sloppyclass = false;[/p] [p] [/p] [p]hexa = new makearray(16);[br]for(var i = 0; i < 10; i++)[br]hexa[i] = i;[br]hexa[10]=”a”; hexa[11]=”b”; hexa[12]=”c”;[br]hexa[13]=”d”; hexa[14]=”e”; hexa[15]=”f”; [/p] [p]document.onmouseover = domouseover;[br]document.onmouseout = domouseout;[/p] [p]startcolor = dehexize(startcolor.tolowercase());[br]endcolor = dehexize(endcolor.tolowercase()); [/p] [p]var fadeid = new array(); [/p] [p]function dehexize(color){[br]var colorarr = new makearray(3);[br]for (i=1; i<7; i++){[br]for (j=0; j<16; j++){[br]if (color.charat(i) == hexa[j]){[br]if (i%2 !=0)[br]colorarr[math.floor((i-1)/2)]=eval(j)*16;[br]else[br]colorarr[math.floor((i-1)/2)]+=eval(j);[br]}[br]}[br]}[br]return colorarr;[br]}[/p] [p]function domouseover() {[br]if(document.all){[br]var srcelement = event.srcelement;[br]if ((srcelement.tagname == “a” && autofade) || srcelement.classname == “fade” || (sloppyclass && srcelement.classname.indexof(”fade”) != -1))[br]fade(startcolor,endcolor,srcelement.uniqueid,stepin);[br]}[br]}[/p] [p][br]function domouseout() {[br]if (document.all){[br]var srcelement = event.srcelement;[br]if ((srcelement.tagname == “a” && autofade) || srcelement.classname == “fade” || (sloppyclass && srcelement.classname.indexof(”fade”) != -1))[br]fade(endcolor,startcolor,srcelement.uniqueid,stepout);[br]}[br]}[/p] [p] [/p] [p]function makearray(n) {[br]this.length = n;[br]for(var i = 1; i <= n; i++)[br]this[i] = 0;[br]return this;[br]}[/p] [p][br]function hex(i) {[br]if (i < 0)[br]return “00″;[br]else if (i > 255)[br]return “ff”;[br]else[br]return “” + hexa[math.floor(i/16)] + hexa[i%16];}[/p] [p][br]function setcolor(r, g, b, element) {[br]var hr = hex(r); var hg = hex(g); var hb = hex(b);[br]element.style.color = “#”+hr+hg+hb;[br]} [/p] [p]function fade(s,e, element,step){[br]var sr = s[0]; var sg = s[1]; var sb = s[2];[br]var er = e[0]; var eg = e[1]; var eb = e[2];[/p] [p]if (fadeid[0] != null && fade[0] != element){[br]setcolor(sr,sg,sb,eval(fadeid[0]));[br]var i = 1;[br]while(i < fadeid.length){[br]cleartimeout(fadeid[i]);[br]i++;[br]}[br]}[/p] [p]for(var i = 0; i <= step; i++) {[br]fadeid[i+1] = settimeout(”setcolor(math.floor(” +sr+ ” *(( ” +step+ ” – ” +i+ ” )/ ” +step+ ” ) + ” +er+ ” * (” +i+ “/” +[br]step+ “)),math.floor(” +sg+ ” * (( ” +step+ ” – ” +i+ ” )/ ” +step+ ” ) + ” +eg+ ” * (” +i+ “/” +step+[br]“)),math.floor(” +sb+ ” * ((” +step+ “-” +i+ “)/” +step+ “) + ” +eb+ ” * (” +i+ “/” +step+ “)),”+element+”);”,i*step);[/p] [p] [/p] [p]}[br]fadeid[0] = element;[br]} </script>[/p] [p][br][br]让你的文本链接渐隐渐显 [br] [/p] [p]脚本1

该文章在 2010/4/27 3:04:44 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2026 ClickSun All Rights Reserved  粤ICP备13012886号-2  粤公网安备44030602007207号