电击图片弹出无边自定义窗口 Code: [Copy to clipboard] 〈a href="#"〉〈img src="image/tx.gif" alt="更换头像" width="16" height="16" hspace=10 border=0 onClick="MM_openBrWindow('tx.htm','tx','status=yes,scrollbars=yes,width=280,height=45')"〉〈/a〉 无边框对话框窗口可以在myie中弹出 Code: [Copy to clipboard] 〈script Language="javascript"〉 function 页面名称(WINwidth, WINheight) { showx = event.screenX - event.offsetX - 4 - WINwidth ;; // + deltaX;; showy = event.screenY - event.offsetY + 18;; // + deltaY;; newWINwidth = WINwidth + 4 + 18;; var features = 'dialogWidth:' + newWINwidth + 'px;;' + 'dialogHeight:' + WINheight + 'px;;' + 'dialogLeft:' + showx + 'px;;' + 'dialogTop:' + showy + 'px;;' + 'directories:no;; localtion:no;; menubar:no;; status=no;; toolbar=no;;scrollbars:no;;Resizeable=no';; var endtarget = "弹出页面.htm";; // window.open(endtarget, '', '');; window.showModalDialog(endtarget, " ", features);; } 〈/script〉 Code: [Copy to clipboard] 〈input name="image" type=image onClick="页面名称(230, 35);;return false;;" src="http://www.xiugoo.com/代替按扭的图片.gif" alt="鼠标经过显示的文字" width="16" height="16" 〉 Java代码容错 Code: [Copy to clipboard] 〈SCRIPT LANGUAGE="javascript"〉 〈!-- Hide function killErrors() { return true;; } window.onerror = killErrors;; // --〉 〈/SCRIPT〉 flash透明 Code: [Copy to clipboard] 〈PARAM NAME="wmode" VALUE="transparent"〉 状态栏 +在body中就ok 〈script language="javascript"〉 var MESSAGE = " 欢迎来到落伍者论坛谢谢! " var POSITION = 150 var DELAY = 10 var scroll = new statusMessageObject() function statusMessageObject(p,d) { this.msg = MESSAGE this.out = " " this.pos = POSITION this.delay = DELAY this.i = 0 this.reset = clearMessage} function clearMessage() { this.pos = POSITION} function scroller() { for (scroll.i = 0;; scroll.i 〈 scroll.pos;; scroll.i++) { scroll.out += " "} if (scroll.pos 〉= 0) scroll.out += scroll.msg else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length) window.status = scroll.out scroll.out = " " scroll.pos-- if (scroll.pos 〈 -(scroll.msg.length)) { scroll.reset()} setTimeout ('scroller()',scroll.delay)} function snapIn(jumpSpaces,position) { var msg = scroll.msg var out = "" for (var i=0;; i〈position;; i++) {out += msg.charAt(i)} for (i=1;;i〈jumpSpaces;;i++) {out += " "} out += msg.charAt(position) window.status = out if (jumpSpaces 〈= 1) { position++ if (msg.charAt(position) == ' ') {position++ } jumpSpaces = 100-position } else if (jumpSpaces 〉 3) {jumpSpaces *= .75} else {jumpSpaces--} if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")";; scrollID = window.setTimeout(cmd,scroll.delay);; } else { window.status="" jumpSpaces=0 position=0 cmd = "snapIn(" + jumpSpaces + "," + position + ")";; scrollID = window.setTimeout(cmd,scroll.delay);; return false } return true} snapIn(100,0);; 〈/script〉 1. 页面自动刷新: 2. 把如下代码加入〈head〉区域中 Code: [Copy to clipboard] 〈meta http-equiv="refresh" content="20"〉 其中20指每隔20秒刷新一次页面。 2.页面自动跳转:把如下代码加入〈head〉区域中 Code: [Copy to clipboard] 〈meta http-equiv="refresh" content="20;;url=http://kingsnet.126.com"〉 asp 随机图片显示 百变美女asp代码 Code: [Copy to clipboard] 〈%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%〉 〈% '---------------------------------------------------------------------------------------- '转发时请保留此声明信息,这段声明不并会影响你的显示速度! '************************* 随机图片显示 **************************** '代码设计:野汉子 '使用实例:img.asp?list=图片存放目录 '网站:http://yjj.con.cn '声明:版权没有,随意使用!^_^不过如果各位不介意给我做个小小的连接,在下将感激不尽! '---------------------------------------------------------------------------------------- Function AllPath() Dim Domain,GFilePath Domain = Request.ServerVariables("SERVER_NAME") GFilePath = Request.ServerVariables("PATH_INFO") GFilePath = lcase(left(GFilePath,instrRev(GFilePath,"/"))) AllPath = "http://"&Domain&GFilePath End Function Function ShowFileList(folderspec) Dim Path,objFSO,objFolder,count,objFile,nume,S Path = Server.MapPath(folderspec) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(Path) Then Set objFolder = objFSO.GetFolder(Path) count = 0 For Each objFile in objFolder.Files count = count+1 Next randomize nume = Int((count*rnd)+1) S = 0 ShowFileList = "" For Each objFile in objFolder.Files S = S + 1 If S = nume Then ShowFileList = objFile.Name Exit For End If Next Set objFolder = Nothing Else ShowFileList = "NO" End If Set objFSO = Nothing End Function Dim list,filename,address,str list = trim(Request.QueryString("list")) if list = "" then Response.write "本页需要正确参数引入,您缺少相关的参数!正确格式如下:"&AllPath&"img.asp?list=图片存放目录" Response.End() end if filename = ShowFileList("./"&list&"/") if filename = "NO" then Response.write "您指定的目录〈b〉"&list&"〈/b〉不存在,请重新指定!" Response.End() end if if filename = "" then Response.write "您指定的目录〈b〉"&list&"〈/b〉没有相关的图片文件存在,请重新指定!" Response.End() end if str = right(filename,3) if str〈〉"jpg" and str〈〉"gif" then filename = "erro.gif" end if address = AllPath&list&"/" address = address&filename %〉 〈%Response.redirect(address)%〉 鼠标经过显示不同图片 Code: [Copy to clipboard] 〈SCRIPT LANGUAGE="javascript"〉 var a = new Image();; var b = new Image();; var c = new Image();; a.src = "../../../yanyanyan/me/me/4.jpg";; b.src = "../../../yanyanyan/me/me/3.jpg";; c.src = "../../../yanyanyan/me/me/2.jpg";; function doButtons(picimage) { eval("document['picture'].src = " + picimage + ".src");; } 〈/script〉 〈/head〉 〈body〉 〈table width="407" height="201" border=0 cellpadding="0" cellspacing="0" bgcolor="#333333"〉 〈tr〉〈td width="110" align="center"〉 〈p〉 〈a href="#" onmouseover="doButtons('a')"〉PHOTO 1〈/a〉〈p〉 〈a href="#" onmouseover="doButtons('b')"〉PHOTO 2〈/a〉〈p〉 〈a href="#" onmouseover="doButtons('c')"〉PHOTO 3〈/a〉〈p〉 〈td width="297"〉〈img name=picture src="http://www.xiugoo.com/../../../yanyanyan/me/me/4.jpg" width=294 height=345 border=0〉〈/td〉 〈/tr〉 〈/table〉 Code: [Copy to clipboard] 〈style〉 .jc{ position:relative;; } 〈/style〉 〈script language="javascript1.2"〉 var ns6=document.getElementById&&!document.all var ie=document.all var customcollect=new Array() var i=0 function jiggleit(num){ if ((!document.all&&!document.getElementById)) return;; customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1 } function init(){ if (ie){ while (eval("document.all.jiggle"+i)!=null){ customcollect[i]= eval("document.all.jiggle"+i) i++ } } else if (ns6){ while (document.getElementById("jiggle"+i)!=null){ customcollect[i]= document.getElementById("jiggle"+i) i++ } } if (customcollect.length==1) setInterval("jiggleit(0)",80) else if (customcollect.length〉1) for (y=0;;y〈customcollect.length;;y++){ var tempvariable='setInterval("jiggleit('+y+')",'+'100)' eval(tempvariable) } } window.onload=init 〈/script〉 〈span id="jiggle0" class="jc"〉〈b〉抖动的字〈a href="http://yjj.con.cn"〉Website 俊杰网络!〈/a〉〈/b〉〈/span〉 〈/head〉 标题拦特效 Code: [Copy to clipboard] 〈SCRIPT〉 //change title text to your own var titletext="Welcome to Dynamic Drive" var thetext="" var started=false var step=0 var times=1 function welcometext() { times-- if (times==0) { if (started==false) { started = true;; document.title = titletext;; setTimeout("anim()",1);; } thetext = titletext;; } } function showstatustext(txt) { thetext = txt;; setTimeout("welcometext()",4000) times++ } function anim() { step++ if (step==7) {step=1} if (step==1) {document.title='〉==='+thetext+'===〈'} if (step==2) {document.title='=〉=='+thetext+'==〈='} if (step==3) {document.title='〉=〉='+thetext+'=〈=〈'} if (step==4) {document.title='=〉=〉'+thetext+'〈=〈='} if (step==5) {document.title='==〉='+thetext+'=〈=='} if (step==6) {document.title='===〉'+thetext+'〈==='} setTimeout("anim()",200);; } if (document.title) window.onload=onload=welcometext 〈/SCRIPT〉 文字不同颜色闪烁 〈span style=behavior:url(font.htc)〉这里是要闪烁的字颜色可以很多〈/span〉 font.htc 代码 Code: [Copy to clipboard] ************************************************* 〈PUBLIC:COMPONENT URN="rainbow" name="darainbow()"/〉 〈PUBLIC:ATTACH EVENT = "oncontentready" ONEVENT ="beginIt()"/〉 〈SCRIPT language="javascript"〉 var Kill_ID=null;; var internalValue;; var originalValue;; function putValue(){ element.innerHTML=internalValue;; encapsulate();; startSwirl();; } function eventHandler(){ clearInterval(Kill_ID);; internalValue=element.value;; element.detachEvent("onpropertychange",eventHandler);; if(event.propertyName=="value"){ element.innerHTML=internalValue;; putValue();; } else startSwirl();; element.attachEvent("onpropertychange",eventHandler);; } function swirl(){ var I;; I=ran(internalValue.length-1,0);; if(element.children(I) != null)element.children(I).style.color=randomColor();; } function startSwirl(){ if (element.swirlInterval == null) element.swirlInterval=50;; if ((internalValue!=null) && (element.swirlInterval!=0)) Kill_ID=setInterval(swirl,element.swirlInterval);; } function encapsulate(){ var I;; var tempStr="";; for (I=0;; I 〈 internalValue.length;; I++){ tempStr += "〈SPAN style=\"color:"+randomColor()+"\"〉" + internalValue.substr(I,1) + "〈/SPAN〉";; } innerHTML=tempStr;; } function ran(upperbound, lowerbound){ return(parseInt((upperbound - lowerbound + 1) * Math.random() + lowerbound));; } function randomColor(){ var R=ran(255,0);; var G=ran(255,0);; var B=ran(255,0);; R=R.toString(16);; G=G.toString(16);; B=B.toString(16);; if (R.length==1)R="0"+R;; if (G.length==1)G="0"+G;; if (B.length==1)B="0"+B;; return("#"+R+G+B);; } function beginIt(){ internalValue=element.value;; originalValue=element.innerHTML;; if (internalValue==null) internalValue=element.innerHTML;; putValue();; element.attachEvent("onpropertychange",eventHandler);; } function clearIt(){ clearInterval(Kill_ID);; element.detachEvent("onpropertychange",eventHandler);; element.innerHTML=originalValue;; } 〈/script〉 *************************************** 让连接不停的变色 〈SCRIPT language=javascript src="fade.js"〉〈/SCRIPT〉 演示 http://www.wooshow.com/dw/demo/ln/1.htm fade.js代码 Code: [Copy to clipboard] /************* **** 〈config〉 **/ startColor = "#4D4D4D";; // 颜色可以该 endColor = "#ffffff";; // MouseOver link color stepIn = 10;; // delay when fading in stepOut = 20;; // delay when fading out /* ** set to true or false;; true will ** cause all links to fade automatically ***/ autoFade = true;; /* ** set to true or false;; true will cause all CSS ** classes with "fade" in them to fade onmouseover ***/ sloppyClass = true;; /** **** 〈/config〉 **************/ /************* **** 〈install〉 ** ** **** 〈/install〉 **************/ hexa = new makearray(16);; for(var i = 0;; i 〈 10;; i++) hexa[i] = i;; hexa[10]="a";; hexa[11]="b";; hexa[12]="c";; hexa[13]="d";; hexa[14]="e";; hexa[15]="f";; document.onmouseover = domouseover;; document.onmouseout = domouseout;; startColor = dehexize(startColor.toLowerCase());; endColor = dehexize(endColor.toLowerCase());; var fadeId = new Array();; var timerID = 0;; var theElement,theTagName,theClassName,theUniqueID function dehexize(Color){ var colorArr = new makearray(3);; for (i=1;; i〈7;; i++){ for (j=0;; j〈16;; j++){ if (Color.charAt(i) == hexa[j]){ if (i%2 !=0) colorArr[Math.floor((i-1)/2)]=eval(j)*16;; else colorArr[Math.floor((i-1)/2)]+=eval(j);; } } } return colorArr;; } function domouseover() { if(document.all) { clearTimeout(timerID);; theElement = event.srcElement;; theTagName = theElement.tagName;; theClassName = theElement.className;; theUniqueID = theElement.uniqueID;; if ((theTagName == "A" && autoFade) || theClassName == "fade" || (sloppyClass && theClassName.indexOf("fade") != -1)) { //alert(theElement);; fade(startColor,endColor,theUniqueID,stepIn);; timerID = setTimeout('pulsedown()',500);; } } } function pulseup() { if(document.all) { clearTimeout(timerID);; if ((theTagName == "A" && autoFade) || theClassName == "fade" || (sloppyClass && theClassName.indexOf("fade") != -1)) { //alert(theElement);; fade(startColor,endColor,theUniqueID,stepIn);; timerID = setTimeout('pulsedown(theElement)',500);; } } } function pulsedown(theElement) { if (document.all) { clearTimeout(timerID);; if ((theTagName == "A" && autoFade) || theClassName == "fade" || (sloppyClass && theClassName.indexOf("fade") != -1)) { //alert(theElement);; fade(endColor,startColor,theUniqueID,stepOut);; timerID = setTimeout('pulseup()',500);; } } } function domouseout() { if (document.all) { clearTimeout(timerID);; var srcElement = event.srcElement;; if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1)) fade(endColor,startColor,srcElement.uniqueID,stepOut);; } } function makearray(n) { this.length = n;; for(var i = 1;; i 〈= n;; i++) this[i] = 0;; return this;; } function hex(i) { if (i 〈 0) return "00";; else if (i 〉 255) return "ff";; else return "" + hexa[Math.floor(i/16)] + hexa[i%16];;} function setColor(r, g, b, element) { var hr = hex(r);; var hg = hex(g);; var hb = hex(b);; element.style.color = "#"+hr+hg+hb;; } function fade(s,e, element,step){ var sr = s[0];; var sg = s[1];; var sb = s[2];; var er = e[0];; var eg = e[1];; var eb = e[2];; if (fadeId[0] != null && fade[0] != element){ setColor(sr,sg,sb,eval(fadeId[0]));; var i = 1;; while(i 〈 fadeId.length){ clearTimeout(fadeId[i]);; i++;; } } for(var i = 0;; i 〈= step;; i++) { fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" + step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ ")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");;",i*step);; } fadeId[0] = element;; } 要使背景图案不随文字 ;滚动”的CSS是这样的: Code: [Copy to clipboard] 〈style type="text/css"〉 〈!-- BODY { background: purple url(bg.jpg);; background-repeat:repeat-y;; background-attachment:fixed } --〉 〈/style〉 页面过滤渐变加到〈head〉中 Code: [Copy to clipboard] 〈meta http-equiv="Page-Exit" content="revealTrans(Duration=1,Transition=23)"〉 鼠标移动到版块图标产生的渐变效果 1.inc\main.js末尾增加如下代码: //渐隐渐现函数 nereidFadeObjects = new Object();; nereidFadeTimers = new Object();; function nereidFade(object, destOp, rate, delta) { if (!document.all) {return;;} if (object != "[object]"){ setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);; return;; } clearTimeout(nereidFadeTimers[object.sourceIndex]);; diff = destOp-object.filters.alpha.opacity;; direction = 1;; if (object.filters.alpha.opacity 〉 destOp){ direction = -1;; } delta=Math.min(direction*diff,delta);; object.filters.alpha.opacity+=direction*delta;; if (object.filters.alpha.opacity != destOp){ nereidFadeObjects[object.sourceIndex]=object;; nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);; } } 2.index模板html(7): function showboard ....... if (indexIMG!='') { str = str.replace(/{\$indexIMG}/gi,'〈table align="left"〉〈tr〉〈td〉〈a href="list.asp?boardid='+BoardID+'"〉 〈img src='+indexIMG+' align="top" border="0" style="FILTER: alpha(opacity=40)" onMouseOut=nereidFade(this,40,10,10) onMouseOver=nereidFade(this,100,0,10) 〉〈/a〉〈/td〉〈td width="20"〉〈/td〉〈/tr〉〈/table〉');; } else { str = str.replace(/{\$indexIMG}/gi,'');; } ...... 增加以上红色部分。 任何连接滑过就点击 Code: [Copy to clipboard] 〈script〉 function mClk2() {var source=event.srcElement;;if (source.tagName=="A"){source.click();;self.focus();;}} document.write("〈div onmouseover=mClk2();;〉");; 〈/script〉 不错的向上滚动广告代码 演示 http://gong.88qq.com/88qq_468-60-lun.htm Code: [Copy to clipboard] 〈SCRIPT language=javascript1.2〉 〈!-- var scrollerwidth=470 var scrollerheight=60 var scrollerbgcolor='#cccccc' var pausebetweenimages=10000 var waitingtime=20 var slideimages=new Array() slideimages[0]='〈iframe src="http://gong.88qq.com/88qq_468-60-5.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' slideimages[1]='〈iframe src="http://gong.88qq.com/88qq_468-60-2.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' slideimages[2]='〈iframe src="http://gong.88qq.com/88qq_468-60-1.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' slideimages[3]='〈iframe src="http://gong.88qq.com/88qq_468-60-4.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' slideimages[4]='〈iframe src="http://gong.88qq.com/88qq_468-60-3.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' slideimages[5]='〈iframe src="http://gong.88qq.com/88qq_468-60-6.htm" width="468" height="60" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"〉〈/iframe〉' if (slideimages.length〉1) i=2 else i=0 function move1(whichlayer){ tlayer=eval(whichlayer) if (tlayer.top〉0&&tlayer.top〈=5){ tlayer.top=0 setTimeout("move1(tlayer)",pausebetweenimages) setTimeout("move2(document.main.document.second)",pausebetweenimages) return } if (tlayer.top〉=tlayer.document.height*-1){ tlayer.top-=5 setTimeout("move1(tlayer)",waitingtime) } else{ tlayer.top=scrollerheight tlayer.document.write(slideimages[i]) tlayer.document.close() if (i==slideimages.length-1) i=0 else i++ }} function move2(whichlayer){ tlayer2=eval(whichlayer) if (tlayer2.top〉0&&tlayer2.top〈=5){ tlayer2.top=0 setTimeout("move2(tlayer2)",pausebetweenimages) setTimeout("move1(document.main.document.first)",pausebetweenimages) return } if (tlayer2.top〉=tlayer2.document.height*-1){ tlayer2.top-=5 setTimeout("move2(tlayer2)",waitingtime) } else{ tlayer2.top=scrollerheight tlayer2.document.write(slideimages[i]) tlayer2.document.close() if (i==slideimages.length-1) i=0 else i++ }} function move3(whichdiv){ tdiv=eval(whichdiv) if (tdiv.style.pixelTop〉0&&tdiv.style.pixelTop〈=5){ tdiv.style.pixelTop=0 setTimeout("move3(tdiv)",pausebetweenimages) setTimeout("move4(second2)",pausebetweenimages) return } if (tdiv.style.pixelTop〉=tdiv.offsetHeight*-1){ tdiv.style.pixelTop-=5 setTimeout("move3(tdiv)",waitingtime) } else{ tdiv.style.pixelTop=scrollerheight tdiv.innerHTML=slideimages[i] if (i==slideimages.length-1) i=0 else i++ } } function move4(whichdiv){ tdiv2=eval(whichdiv) if (tdiv2.style.pixelTop〉0&&tdiv2.style.pixelTop〈=5){ tdiv2.style.pixelTop=0 setTimeout("move4(tdiv2)",pausebetweenimages) setTimeout("move3(first2)",pausebetweenimages) return } if (tdiv2.style.pixelTop〉=tdiv2.offsetHeight*-1){ tdiv2.style.pixelTop-=5 setTimeout("move4(second2)",waitingtime |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )
GMT+8, 2024-9-30 17:29 , Processed in 0.266271 second(s), 12 queries , Gzip On, MemCache On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.