网站公告 :
先有卞和慧眼识玉,
才有璞玉磨石成壁。
茶心苦涩遇水甘甜,
网络青阁知己而乐。
建站代码之滑出式菜单导航特效代码:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>网页特效|Linkweb.cn/Js|---滑出式菜单</title> <style> <!-- #ssm2 A { color:black; text-decoration:none; font-size:12; font-family:verdana; } #ssm2 A:hover { color:red; } --> </style> </head> <body> <script language="JavaScript"> function MM_displayStatusMsg(msgStr) { status=msgStr; document.MM_returnValue = true; } function highlight(x){ document.forms[x].elements[0].focus() document.forms[x].elements[0].select() } function MM_jumpMenu(targ,selObj,restore){ eval(targ+".location="+selObj.options[selObj.selectedIndex].value+""); if (restore) selObj.selectedIndex=0; } var NS IE=document.all; NS=document.layers; hdrFontFamily="Verdana"; hdrFontSize="2"; hdrFontColor="white"; hdrBGColor="#666666"; linkFontFamily="Verdana"; linkFontSize="2"; linkBGColor="white"; linkOverBGColor="#CCCCCC"; linkTarget="_top"; YOffset=60; staticYOffset=20; menuBGColor="black"; menuIsStatic="no"; menuHeader="大类菜单1" menuWidth=150; // Must be a multiple of 5! staticMode="advanced" barBGColor="#1298fd"; barFontFamily="Verdana"; barFontSize="2"; barFontColor="white"; barText="滑出式菜单"; function moveOut() { if (window.cancel) { cancel=""; } if (window.moving2) { clearTimeout(moving2); moving2=""; } if ((IE && ssm2.style.pixelLeft<0)||(NS && document.ssm2.left<0)) { if (IE) {ssm2.style.pixelLeft += (5%menuWidth); } if (NS) { document.ssm2.left += (5%menuWidth); } moving1 = setTimeout(moveOut(), 5) } else { clearTimeout(moving1) } }; function moveBack() { cancel = moveBack1() } function moveBack1() { if (window.moving1) { clearTimeout(moving1) } if ((IE && ssm2.style.pixelLeft>(-menuWidth))||(NS && document.ssm2.left>(-150))) { if (IE) {ssm2.style.pixelLeft -= (5%menuWidth); } if (NS) { document.ssm2.left -= (5%menuWidth); } moving2 = setTimeout(moveBack1(), 5)} else { clearTimeout(moving2) } }; lastY = 0; function makeStatic(mode) { if (IE) {winY = document.body.scrollTop;var NM=ssm2.style } if (NS) {winY = window.pageYOffset;var NM=document.ssm2 } 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+=smooth; if (NS) NM.top+=smooth; lastY = lastY+smooth; } setTimeout(makeStatic("smooth"), 1) } else if (mode=="advanced") { if ((IE||NS) && winY>YOffset-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(makeStatic("advanced"), 1) } } function init() { if (IE) { ssm2.style.pixelLeft = -menuWidth; ssm2.style.visibility = "visible" } else if (NS) { document.ssm2.left = -menuWidth; document.ssm2.visibility = "show" } else { alert(Choose either the "smooth" or "advanced" static modes!) } } function MM_displayStatusMsg(msgStr) { status=msgStr; document.MM_returnValue = true; } </script> <script language="JavaScript"> if (IE) {document.write(<DIV ID="ssm2" style="visibility:hidden;Position : Absolute ;Left : 0px ;Top : +YOffset+px ;Z-Index : 20;width:1px" onmouseover="moveOut()" onmouseout="moveBack()">)} if (NS) {document.write(<LAYER visibility="hide" top="+YOffset+" name="ssm2" bgcolor="+menuBGColor+" left="0" onmouseover="moveOut()" onmouseout="moveBack()">)} tempBar="" for (i=0;i<barText.length;i++) { tempBar+=barText.substring(i, i+1)+"<BR>"} document.write(<table border="0" cellpadding="0" cellspacing="1" width="+(menuWidth+16+2)+" bgcolor="+menuBGColor+"><tr><td bgcolor="+hdrBGColor+" WIDTH="+menuWidth+"> <font face="+hdrFontFamily+" Size="+hdrFontSize+" COLOR="+hdrFontColor+"><b>+menuHeader+</b></font></td><td align="center" rowspan="100" width="16" bgcolor="+barBGColor+"><p align="center"><font face="+barFontFamily+" Size="+barFontSize+" COLOR="+barFontColor+"><B>+tempBar+</B></font></p></TD></tr>) function addItem(text, link, target) { if (!target) {target=linkTarget} document.write(<TR><TD BGCOLOR="+linkBGColor+" onmouseover="bgColor=\+linkOverBGColor+\" onmouseout="bgColor=\+linkBGColor+\"><ILAYER><LAYER onmouseover="bgColor=\+linkOverBGColor+\" onmouseout="bgColor=\+linkBGColor+\" WIDTH="100%"><FONT face="+linkFontFamily+" Size="+linkFontSize+"> <A HREF="+link+" target="+target+" CLASS="ssm2Items">+text+</A></FONT></LAYER></ILAYER></TD></TR>)} function addHdr(text) { document.write(<tr><td bgcolor="+hdrBGColor+" WIDTH="140"> <font face="+hdrFontFamily+" Size="+hdrFontSize+" COLOR="+hdrFontColor+"><b>+text+</b></font></td></tr>)} //Only edit the script between HERE addItem( 小类菜单1, #, _blank); addItem( 小类菜单2, #, _blank); addItem( 小类菜单3, #, _blank); addItem( 小类菜单4, #, _blank); addItem( 小类菜单5, #, _blank); addItem( 小类菜单6, #, _blank); addHdr(大类菜单2); addItem( 小类菜单1, #, _blank); addItem( 小类菜单2, #, _blank); addItem( 小类菜单3, #, _blank); addItem( 小类菜单4, #, _blank); addItem( 小类菜单5, #, _blank); addItem( 小类菜单6, #, _blank); // and HERE! No more! document.write(<tr><td bgcolor="+hdrBGColor+"><font size="0" face="Arial"> </font></td></TR></table>) if (IE) {document.write(</DIV>)} if (NS) {document.write(</LAYER>)} if ((IE||NS) && (menuIsStatic=="yes"&&staticMode)) {makeStatic(staticMode);} </script> <script> window.onload=init </script> </body> </html>
效果:
效果请点预览观看
建站代码之进入网页菜单逐渐放大弹出导航特效代码:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>网页特效|Linkweb.cn/Js|---进入网页菜单逐渐放大弹出</title> </head> <body background="../images/bg.gif" onload="dynAnimation()" language="Javascript1.2"> <SCRIPT language=JavaScript FPTYPE="dynamicanimation"> <!-- dynamicanimAttr = "dynamicanimation" animateElements = new Array() currentElement = 0 speed = 0 stepsZoom = 8 stepsWord = 8 stepsFly = 12 stepsSpiral = 16 steps = stepsZoom step = 0 outString = "" function dynAnimation() { var ms = navigator.appVersion.indexOf("MSIE") ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4) if(!ie4) { if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion.substring(0, 1)) >= 4)) { for (index=document.layers.length-1; index >= 0; index--) { layer=document.layers[index] if (layer.left==10000) layer.left=0 } } return } for (index=document.all.length-1; index >= document.body.sourceIndex; index--) { el = document.all[index] animation = el.getAttribute(dynamicanimAttr, false) if(null != animation) { if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord") { ih = el.innerHTML outString = "" i1 = 0 iend = ih.length while(true) { i2 = startWord(ih, i1) if(i2 == -1) i2 = iend outWord(ih, i1, i2, false, "") if(i2 == iend) break i1 = i2 i2 = endWord(ih, i1) if(i2 == -1) i2 = iend outWord(ih, i1, i2, true, animation) if(i2 == iend) break i1 = i2 } document.all[index].innerHTML = outString document.all[index].style.posLeft = 0 document.all[index].setAttribute(dynamicanimAttr, null) } if(animation == "zoomIn" || animation == "zoomOut") { ih = el.innerHTML outString = "<SPAN " + dynamicanimAttr + "=\"" + animation + "\" style=\"position: relative; left: 10000;\">" outString += ih outString += "</SPAN>" document.all[index].innerHTML = outString document.all[index].style.posLeft = 0 document.all[index].setAttribute(dynamicanimAttr, null) } } } i = 0 for (index=document.body.sourceIndex; index < document.all.length; index++) { el = document.all[index] animation = el.getAttribute(dynamicanimAttr, false) if (null != animation) { if(animation == "flyLeft") { el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = 0 } else if(animation == "flyRight") { el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth el.style.posTop = 0 } else if(animation == "flyTop" || animation == "dropWord") { el.style.posLeft = 0 el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight } else if(animation == "flyBottom") { el.style.posLeft = 0 el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight } else if(animation == "flyTopLeft") { el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight } else if(animation == "flyTopRight" || animation == "flyTopRightWord") { el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight } else if(animation == "flyBottomLeft") { el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight } else if(animation == "flyBottomRight" || animation == "flyBottomRightWord") { el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight } else if(animation == "spiral") { el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight } else if(animation == "zoomIn") { el.style.posLeft = 10000 el.style.posTop = 0 } else if(animation == "zoomOut") { el.style.posLeft = 10000 el.style.posTop = 0 } else { el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = 0 } el.initLeft = el.style.posLeft el.initTop = el.style.posTop animateElements[i++] = el } } window.setTimeout("animate();", speed) } function offsetLeft(el) { x = el.offsetLeft for (e = el.offsetParent; e; e = e.offsetParent) x += e.offsetLeft; return x } function offsetTop(el) { y = el.offsetTop for (e = el.offsetParent; e; e = e.offsetParent) y += e.offsetTop; return y } function startWord(ih, i) { for(tag = false; i < ih.length; i++) { c = ih.charAt(i) if(c == <) tag = true if(!tag) return i if(c == >) tag = false } return -1 } function endWord(ih, i) { nonSpace = false space = false while(i < ih.length) { c = ih.charAt(i) if(c != ) nonSpace = true if(nonSpace && c == ) space = true if(c == <) return i if(space && c != ) return i i++ } return -1 } function outWord(ih, i1, i2, dyn, anim) { if(dyn) outString += "<SPAN " + dynamicanimAttr + "=\"" + anim + "\" style=\"position: relative; left: 10000;\">" outString += ih.substring(i1, i2) if(dyn) outString += "</SPAN>" } function animate() { el = animateElements[currentElement] animation = el.getAttribute(dynamicanimAttr, false) step++ if(animation == "spiral") { steps = stepsSpiral v = step/steps rf = 1.0 - v t = v * 2.0*Math.PI rx = Math.max(Math.abs(el.initLeft), 200) ry = Math.max(Math.abs(el.initTop), 200) el.style.posLeft = Math.ceil(-rf*Math.cos(t)*rx) el.style.posTop = Math.ceil(-rf*Math.sin(t)*ry) } else if(animation == "zoomIn") { steps = stepsZoom el.style.fontSize = Math.ceil(50+50*step/steps) + "%" el.style.posLeft = 0 } else if(animation == "zoomOut") { steps = stepsZoom el.style.fontSize = Math.ceil(100+200*(steps-step)/steps) + "%" el.style.posLeft = 0 } else { steps = stepsFly if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord") steps = stepsWord dl = el.initLeft / steps dt = el.initTop / steps el.style.posLeft = el.style.posLeft - dl el.style.posTop = el.style.posTop - dt } if (step >= steps) { el.style.posLeft = 0 el.style.posTop = 0 currentElement++ step = 0 } if(currentElement < animateElements.length) window.setTimeout("animate();", speed) } //--> </SCRIPT> <BODY onload="dynAnimation()" language="Javascript1.2"> <div align=center> <table width="400" border="0" height="333"> <tr> <td height="300"> <p style="LEFT: 10000px! important; POSITION: relative! important" dynamicanimation="zoomIn"> <a href="#">网页特效</a></p> <p style="LEFT: 10000px! important; POSITION: relative! important" dynamicanimation="zoomIn"> <a href="#">学习教程</a></p> </td></tr></table></div> </body> </html>
本站源码和一些文章收集于互联网如有侵权或其它问题请及时联系我们,以便及时处理!
张永庆的空间版权所有 copyright 2009-07-20
( http://www.qgcxjs.com)
All rights reserved 苏ICP备13013770号
苏公网安备 32083002000040号
返回首页 | 源码分享 | 创业经验 |php源码 | asp源码 | 建站代码 | 建站技巧 | 免费祝福