网页菜单特效代码_第1页
网页菜单特效代码_第2页
网页菜单特效代码_第3页
网页菜单特效代码_第4页
网页菜单特效代码_第5页
已阅读5页,还剩61页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、自动收缩导航!-将以下代码参加HTML的之间-ie=document.all?1:0n=document.layers?1:0lshow=60var move=10;menuSpeed=40var moveOnScroll=truevar tim;var ltop;function makeMenu(obj,nest) nest=(!nest) ? :document.+nest+. this.css=(n) ? eval(nest+document.+obj):eval(obj+.style) this.state=1 this.go=0 this.width=n?this.css.docu

2、ment.width:eval(obj+.offsetWidth) this.left=b_getleft this.obj = obj + Object; eval(this.obj + =this)function b_getleft() var gleft=(n) ? eval(this.css.left):eval(this.css.pixelLeft); return gleft;function moveMenu() if(!oMenu.state) clearTimeout(tim) mIn() else clearTimeout(tim) mOut() function mIn

3、() if(oMenu.left()-oMenu.width+lshow) oMenu.go=1 oMenu.css.left=oMenu.left()-move tim=setTimeout(mIn(),menuSpeed) else oMenu.go=0 oMenu.state=1 function mOut() if(oMenu.left()0) oMenu.go=1 oMenu.css.left=oMenu.left()+move tim=setTimeout(mOut(),menuSpeed) else oMenu.go=0 oMenu.state=0 function checkS

4、crolled() if(!oMenu.go) oMenu.css.top=eval(scrolled)+ltop if(n) setTimeout(checkScrolled(),30)function menuInit() oMenu=new makeMenu(divMenu) scrolled=n?window.pageYOffset:document.body.scrollTop oMenu.css.left=-oMenu.width+lshow ltop=(n)?oMenu.css.top:oMenu.css.pixelTop; oMenu.css.visibility=visibl

5、e if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();onload=menuInit; 网页特效梦工厂-天空下载-大富翁论坛-Codelphi-好123- - 导航菜单 HYPERLINK :/ 7stk /caidan/c11.htm t right 滑动导航菜单代码!-将以下代码参加HTML的之间-function MM_displayStatusMsg(msgStr) status=msgStr; document.MM_returnValue = true;function highlight(x)doc

6、ument.formsx.elements0.focus()document.formsx.elements0.select()function MM_jumpMenu(targ,selObj,restore) eval(targ+.location=+selObj.optionsselObj.selectedIndex.value+); if (restore) selObj.selectedIndex=0;var NSIE=document.all;NS=document.layers;hdrFontFamily=Verdana;hdrFontSize=2;hdrFontColor=whi

7、te;hdrBGColor=#666666;linkFontFamily=Verdana;linkFontSize=2;linkBGColor=white;linkOverBGColor=#CCCCCC;linkTarget=_top;YOffset=60;staticYOffset=20;menuBGColor=black;menuIsStatic=no;menuHeader=欢送光临menuWidth=150; / Must be a multiple of 5!staticMode=advancedbarBGColor=#1298fd;barFontFamily=Verdana;barF

8、ontSize=2;barFontColor=white;barText=导航菜单function moveOut() if (window.cancel) cancel=;if (window.moving2) clearTimeout(moving2); moving2=;if (IE & ssm2.style.pixelLeft0)|(NS & document.ssm2.left(-menuWidth)|(NS & document.ssm2.left(-150) if (IE) ssm2.style.pixelLeft -= (5%menuWidth);if (NS) documen

9、t.ssm2.left -= (5%menuWidth);moving2 = setTimeout(moveBack1(), 5) else clearTimeout(moving2) ;lastY = 0;function makeStatic(mode) if (mode=smooth) if (IE|NS) & winY!=lastY) smooth = .2 * (winY - lastY); if(smooth 0) smooth = Math.ceil(smooth); else smooth = Math.floor(smooth); if (IE) NM.pixelTop+=s

10、mooth; if (NS) NM.top+=smooth; lastY = lastY+smooth;setTimeout(makeStatic(smooth), 1)else if (mode=advanced) if (IE|NS) & winYYOffset-staticYOffset) if (IE) NM.pixelTop=winY+staticYOffset if (NS) NM.top=winY+staticYOffset else if (IE) NM.pixelTop=YOffset if (NS) NM.top=YOffset-7 setTimeout(makeStati

11、c(advanced), 1) function init() if (IE) ssm2.style.pixelLeft = -menuWidth;ssm2.style.visibility = visibleelse if (NS) document.ssm2.left = -menuWidth;document.ssm2.visibility = showelse alert(Choose either the smooth or advanced static modes!)function MM_displayStatusMsg(msgStr) status=msgStr; docum

12、ent.MM_returnValue = true; if (IE) document.write()if (NS) document.write()tempBar=for (i=0;ibarText.length;i+) tempBar+=barText.substring(i, i+1)+document.write( +menuHeader+tempBar+)function addItem(text, link, target) if (!target) target=linkTargetdocument.write( +text+)function addHdr(text) docu

13、ment.write( +text+)addItem(网页特效梦工厂, :/ 7stk /touxiao, );addItem(天空下载, :/ skycn , );addHdr(友情连接);addItem(大富翁论坛, :/ 163 , );addItem(Codelphi, :/ 163 , );addItem(中国软件, :/ , );document.write( )if (IE) document.write()if (NS) document.write()if (IE|NS) & (menuIsStatic=yes&staticMode) makeStatic(staticMod

14、e); window.onload=init HYPERLINK :/ 7stk /caidan/c17.htm t right 滚动链接导航代码脚本说明:把如下代码参加区域中 var scrollerwidth=115var scrollerheight=131var scrollerbgcolor=#FFFFFF/3000 miliseconds=9 secondsvar pausebetweenimages=4000var slideimages=new Array()slideimages0=中文雅虎首都在线网络特区风 云 居slideimages1=你的链接你的链接你的链接你的链接s

15、lideimages2=中文雅虎首都在线网络特区你的链接slideimages3=你的链接你的链接你的链接你的链接 if (slideimages.length1)i=2elsei=0function move1(whichlayer)tlayer=eval(whichlayer)if (tlayer.top0&tlayer.top=tlayer.document.height*-1)tlayer.top-=4setTimeout(move1(tlayer),100)elsetlayer.top=scrollerheighttlayer.document.write(slideimagesi)

16、tlayer.document.close()if (i=slideimages.length-1)i=0elsei+function move2(whichlayer)tlayer2=eval(whichlayer)if (tlayer2.top0&tlayer2.top=tlayer2.document.height*-1)tlayer2.top-=4setTimeout(move2(tlayer2),100)elsetlayer2.top=scrollerheighttlayer2.document.write(slideimagesi)tlayer2.document.close()i

17、f (i=slideimages.length-1)i=0elsei+function move3(whichdiv)tdiv=eval(whichdiv)if (tdiv.style.pixelTop0&tdiv.style.pixelTop=tdiv.offsetHeight*-1)tdiv.style.pixelTop-=4setTimeout(move3(tdiv),100)elsetdiv.style.pixelTop=scrollerheighttdiv.innerHTML=slideimagesiif (i=slideimages.length-1)i=0elsei+functi

18、on move4(whichdiv)tdiv2=eval(whichdiv)if (tdiv2.style.pixelTop0&tdiv2.style.pixelTop=tdiv2.offsetHeight*-1)tdiv2.style.pixelTop-=4setTimeout(move4(second2),100)elsetdiv2.style.pixelTop=scrollerheighttdiv2.innerHTML=slideimagesiif (i=slideimages.length-1)i=0elsei+function startscroll()if (document.al

19、l)move3(first2)second2.style.top=scrollerheightelse if (document.layers)move1(document.main.document.first)document.main.document.second.top=scrollerheight+5document.main.document.second.visibility=showwindow.onload=startscrollif (document.layers)document.write(slideimages0)if (document.layers)docum

20、ent.write(slideimages1)if (document.layers)document.write(slideimages0)if (document.all)document.writeln()document.writeln()document.writeln()document.write(slideimages0)document.writeln()document.writeln()document.write(slideimages1)document.writeln()document.writeln()document.writeln() HYPERLINK :

21、/ 7stk /caidan/c46.htm t right QQ菜单代码特效网页特效- 模拟QQ菜单效果A:link COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: noneA:visited COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: noneA:hover COLOR: #006CD9; FONT-SIZE: 12px; TEXT-DECORATION: noneBODY FONT-SIZE: 12px;TD FONT-SIZE: 12px; line-height: 150%!-

22、function showitem(id,name)return (+name+)function switchoutlookBar(number)var i = outlookbar.opentitle;outlookbar.opentitle=number;var id1,id2,id1b,id2bif (number!=i & outlooksmoothstat=0)if (number!=-1)if (i=-1)id2=blankdiv;id2b=blankdiv;elseid2=outlookdiv+i;id2b=outlookdivin+i;document.all(outlook

23、title+i).style.border=1px none navy;document.all(outlooktitle+i).style.background=outlookbar.maincolor;document.all(outlooktitle+i).style.color=#ffffff;document.all(outlooktitle+i).style.textalign=center;id1=outlookdiv+numberid1b=outlookdivin+numberdocument.all(outlooktitle+number).style.border=1px

24、none white;document.all(outlooktitle+number).style.background=outlookbar.maincolor; /titledocument.all(outlooktitle+number).style.color=#ffffff;document.all(outlooktitle+number).style.textalign=center;smoothout(id1,id2,id1b,id2b,0);elsedocument.all(blankdiv).style.display=;document.all(blankdiv).sry

25、le.height=100%;document.all(outlookdiv+i).style.display=none;document.all(outlookdiv+i).style.height=0%;document.all(outlooktitle+i).style.border=1px none navy;document.all(outlooktitle+i).style.background=outlookbar.maincolor;document.all(outlooktitle+i).style.color=#ffffff;document.all(outlooktitl

26、e+i).style.textalign=center;function smoothout(id1,id2,id1b,id2b,stat)if(stat=0)tempinnertext1=document.all(id1b).innerHTML;tempinnertext2=document.all(id2b).innerHTML;document.all(id1b).innerHTML=;document.all(id2b).innerHTML=;outlooksmoothstat=1;document.all(id1b).style.overflow=hidden;document.al

27、l(id2b).style.overflow=hidden;document.all(id1).style.height=0%;document.all(id1).style.display=;setTimeout(smoothout(+id1+,+id2+,+id1b+,+id2b+,+outlookbar.inc+),outlookbar.timedalay);elsestat+=outlookbar.inc;if (stat100)stat=100;document.all(id1).style.height=stat+%;document.all(id2).style.height=(

28、100-stat)+%;if (stat100) setTimeout(smoothout(+id1+,+id2+,+id1b+,+id2b+,+stat+),outlookbar.timedalay);elsedocument.all(id1b).innerHTML=tempinnertext1;document.all(id2b).innerHTML=tempinnertext2;outlooksmoothstat=0;document.all(id1b).style.overflow=auto;document.all(id2).style.display=none;function g

29、etOutLine()outline=;for (i=0;i(outlookbar.titlelist.length);i+)outline+=;outline+=outlookbar.titlelisti.title+;outline+=;for (j=0;joutlookbar.itemlisti.length;j+)outline+=showitem(outlookbar.itemlistij.key,outlookbar.itemlistij.title);outline+=outline+=return outlinefunction show()var outline;outlin

30、e=outline+=outlookbar.getOutLine();outline+=document.write(outline);function theitem(intitle,instate,inkey)this.state=instate;this.otherclass= nowrap ;this.key=inkey;this.title=intitle;function addtitle(intitle)outlookbar.itemlistoutlookbar.titlelist.length=new Array();outlookbar.titlelistoutlookbar

31、.titlelist.length=new theitem(intitle,1,0);return(outlookbar.titlelist.length-1);function additem(intitle,parentid,inkey)if (parentid=0 & parentid=outlookbar.titlelist.length)outlookbar.itemlistparentidoutlookbar.itemlistparentid.length=new theitem(intitle,2,inkey);outlookbar.itemlistparentidoutlook

32、bar.itemlistparentid.length-1.otherclass= nowrap align=left style=height:5 ;return(outlookbar.itemlistparentid.length-1);elseadditem=-1;function outlook()this.titlelist=new Array();this.itemlist=new Array();this.divstyle=style=height:100%;width:100%;overflow:auto align=center;this.otherclass=border=

33、0 cellspacing=0 cellpadding=0 style=height:100%;width:100%valign=middle align=center ;this.addtitle=addtitle;this.additem=additem;this.starttitle=-1;this.show=show;this.getOutLine=getOutLine;this.opentitle=this.starttitle;this.reflesh=outreflesh;this.timedelay=50;this.inc=10;this.maincolor = #336699

34、function outreflesh()document.all(outLookBarDiv).innerHTML=outlookbar.getOutLine();function locatefold(foldname)if (foldname=)foldname = outlookbar.titlelist0.titlefor (var i=0;i HYPERLINK :/ 7stk /caidan/201.htm t right 鼠标触发型导航菜单1 把如下代码复制到与之间function getNames(obj,name,tij)var p = document.getElemen

35、tById(obj);var plist = p.getElementsByTagName(tij);var rlist = new Array();for(i=0;iplist.length;i+)if(plisti.getAttribute(name) = name)rlistrlist.length = plisti;return rlist;function butong_net(obj,name)var p = obj.parentNode.getElementsByTagName(td);var p1 = getNames(name,f,div);for(i=0;ip1.lengt

36、h;i+)if(obj=pi)pi.className = s;p1i.className = dis;elsepi.className = ;p1i.className = undis;2 把如下代码复制到与之间 网页特效集锦 网页工具库1 网页工具库2 网页工具库3 背景按钮特效 导航菜单特效 网页图片特效 网页文本特效 另类网页特效 在线html编辑器 在线CSS编辑器 网页颜色选择器 滚动条颜色生成器 弹出窗口生成器 页面过渡效果生成器 网页加密解密工具 文本繁简体转换工具 汉字转换成拼音工具 文字加密解密工具 腾讯QQ网页在线客服(1)网页特效代码-腾讯QQ网页在线客服,随网页滚动条

37、上下移动的效果一 function picsize(obj,MaxWidth) img=new Image(); img.src=obj.src; if (img.widthMaxWidth) return MaxWidth; else return img.width; function CloseQQ()divStayTopleft.style.display=none;return true; var online= new Array(); 客户效劳document.write();document.write();function FloatTop() var startX1 =do

38、cument.body.offsetWidth-125 ,startY1 = 5; var startX2 =0,startY2 = 95; var ns = (navigator.appName.indexOf(Netscape) != -1); var d = document; function ml(id,startX,startY) var el=d.getElementById?d.getElementById(id):d.all?d.allid:d.layersid; if(d.layers)el.style=el; el.sP=function(x,y)this.style.l

39、eft=x;this.style.top=y; el.x = startX; el.y = startY; return el; window.stayTopLeft=function() var pY = ns ? pageYOffset : document.body.scrollTop; ftlObj.y += (pY + startY1 - ftlObj.y)/8; ftlObj1.y += (pY + startY2 - ftlObj1.y)/8; ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ft

40、lObj.y); ftlObj1.sP(ftlObj1.x, ftlObj1.y); setTimeout(stayTopLeft(), 30); / ftlObj = ml(divStay,document.body.scrollLeft+document.body.offsetWidth-125,0);/ ftlObj1 = ml(divStayTopLeft,0,30); ftlObj = ml(divStay,(document.body.scrollLeft+document.body.offsetWidth)/2+379,0); ftlObj1 = ml(divStayTopLef

41、t,(document.body.scrollLeft+document.body.offsetWidth)/2+379,30); stayTopLeft();FloatTop(); 腾讯QQ网页在线客服(2)腾讯QQ网页在线客服,隐藏在网页一侧的隐现效果二function move(x, y) if (document.all) object1.style.pixelLeft += x;object1.style.pixelTop += y;elseif (document.layers) document.object1.left += x;document.object1.top +=

42、y;function position() document.object1.left += -200;document.object1.top += 0;document.object1.visibility = show;function makeStatic() if (document.all) object1.style.pixelTop=document.body.scrollTop+100else eval(document.object1.top=eval(window.pageYOffset+20);setTimeout(makeStatic(),0);if (documen

43、t.all)document.write()BODY MARGIN: 0px站点留言簿 if (document.all)document.write()会变色的链接!- Begin function initArray() for (var i = 0; i 绿色下拉透明菜单网页特效代码-非常棒的绿色下拉透明菜单var mmenus = new Array();var misShow = new Boolean(); misShow=false;var misdown = new Boolean();misdown=false;var mnumberofsub=0;var musestatu

44、s=false;var mpopTimer = 0;mmenucolor=#89CB10;mfontcolor=MenuText;mmenuoutcolor=#ADEF34;mmenuincolor=#B5E74E;mmenuoutbordercolor=#ECFA3A;mmenuinbordercolor=#5A2614;mmidoutcolor=#A9DA1D;mmidincolor=#799310;mmenuovercolor=#004080;mitemedge=0;msubedge=1;mmenuunitwidth=66;mmenuitemwidth=140;mmenuheight=2

45、5;mmenuwidth=100%;mmenuadjust=0;mmenuadjustV=0;mfonts=font-family: 宋体; font-size: 9pt; color: MenuText; ;mcursor=hand;var swipeSteps = 4;var swipemsec = 25;var swipeArray = new Array();function swipe(el, dir, steps, msec) if (steps = null) steps = swipeSteps;if (msec = null) msec = swipemsec;if (el.

46、swipeIndex = null)el.swipeIndex = swipeArray.length;if (el.swipeTimer != null)window.clearTimeout(el.swipeTimer);swipeArrayel.swipeIndex = el;el.style.clip = rect(-99999, 99999, 99999, -99999);if (el.swipeCounter = null | el.swipeCounter = 0) Left = el.offsetLeft;Top = el.offsetTop;Width = el.offset

47、Width;Height = el.offsetHeight;el.swipeCounter = steps;el.style.clip = rect(0,0,0,0);window.setTimeout(repeat( + dir + , + el.swipeIndex + , + steps + , + msec + ), msec);function repeat(dir, index, steps, msec) el = swipeArrayindex;var left = Left;var top = Top;var width = Width;var height = Height

48、;if (el.swipeCounter = 0) el.style.clip = rect(-99999, 99999, 99999, -99999);return;else el.swipeCounter-;el.style.visibility = visible;switch (dir) case 2:el.style.clip = rect( + height*el.swipeCounter/steps + , + width + , + height + , + 0 + );el.style.top = top - height*el.swipeCounter/steps;brea

49、k;case 8:el.style.clip = rect( + 0 + , + width + , + height*(steps-el.swipeCounter)/steps + , + 0 + );el.style.top = top + height*el.swipeCounter/steps;break;case 6:el.style.clip = rect( + 0 + , + width + , + height + , + width*(el.swipeCounter)/steps + );el.style.left = left - width*el.swipeCounter

50、/steps;break;case 4:el.style.clip = rect( + 0 + , + width*(swipeSteps - el.swipeCounter)/steps + , + height + , + 0 + );el.style.left = left + width*el.swipeCounter/steps;break;el.swipeTimer = window.setTimeout(repeat( + dir + , + index + , + steps + , + msec + ), msec);var mtmpleft=;var mtmptop=;fu

51、nction hideSwipe(el) window.clearTimeout(el.swipeTimer);el.style.visibility = hidden;el.style.clip = rect(-99999, 99999, 99999, -99999);el.swipeCounter = 0;if(mtmpleft!=)el.style.left = mtmpleft;if(mtmptop!=)el.style.top = mtmptop;function stoperror()return true;window.onerror=stoperror;function mpo

52、pOut() mpopTimer = setTimeout(mallhide(), 500);function getReal(el, type, value) temp = el;while (temp != null) & (temp.tagName != BODY) if (eval(temp. + type) = value) el = temp;return el;temp = temp.parentElement;return el;function mMenuRegister(menu) mmenusmmenus.length = menu return (mmenus.leng

53、th - 1)function mMenuItem(caption,command,target,isline,statustxt,level,img,sizex,sizey,pos)this.items = new Array();this.caption=caption;this mand=command;this.target=target;this.isline=isline;this.statustxt=statustxt;if(level!=null)mnumberofsub+;this.hasc=mnumberofsub;this.level=level;this.img=img

54、;this.sizex=sizex;this.sizey=sizey;this.pos=pos;function mMenu(caption,command,target,img,sizex,sizey,pos)this.items = new Array();this.caption=caption;this mand=command;this.target=target;this.img=img;this.sizex=sizex;this.sizey=sizey;this.pos=pos;this.id=mMenuRegister(this);function mMenuAddItem(i

55、tem) this.itemsthis.items.length = item item.parent = this.id; this.children=true;mMtotype.addItem = mMenuAddItem;mMenuItotype.addsubItem = mMenuAddItem;function mtoout(src)src.style.borderLeftColor=mmenuoutbordercolor;src.style.borderRightColor=mmenuinbordercolor;src.style.borderTopColor=mmenuoutbo

56、rdercolor;src.style.borderBottomColor=mmenuinbordercolor;src.style.backgroundColor=mmenuoutcolor;src.style.color=mmenuovercolor;function mtoin(src)src.style.borderLeftColor=mmenuinbordercolor;src.style.borderRightColor=mmenuoutbordercolor;src.style.borderTopColor=mmenuinbordercolor;src.style.borderB

57、ottomColor=mmenuoutbordercolor;src.style.backgroundColor=mmenuincolor;src.style.color=mmenuovercolor;function mnochange(src)src.style.borderLeftColor=mmenucolor;src.style.borderRightColor=mmenucolor;src.style.borderTopColor=mmenucolor;src.style.borderBottomColor=mmenucolor;src.style.backgroundColor=

58、;src.style.color=mfontcolor;function mallhide()for(var nummenu=0;nummenummenus.length;nummenu+)var themenu=document.allmMenu+nummenuvar themenudiv=document.allmmenudiv+nummenu mnochange(themenu); mmenuhide(themenudiv); for(nummenu=1;nummenudocument.body.clientWidth+document.body.scrollLeft)menuid.st

59、yle.left=document.body.clientWidth+document.body.scrollLeft-mmenuitemwidth;mtmpleft=menuid.style.left;mtmptop=menuid.style.top;swipe(menuid,2,4);misShow=true;function mshowsubmenu(menuid,pid,rid)menuid.style.filter=Alpha(Opacity=80);menuid.style.left=pid.offsetWidth+rid.offsetLeft;menuid.style.top=p

60、id.offsetTop+rid.offsetTop-3;if(mmenuitemwidth+parseInt(menuid.style.left)document.body.clientWidth+document.body.scrollLeft)menuid.style.left=document.body.clientWidth+document.body.scrollLeft-mmenuitemwidth;menuid.style.visibility=visible;function mmenu_over(menuid,x)toel = getReal(window.event.to

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论