背景,文字渐变(无闪屏) 时间:2020-05-11 人气:0 背景变换 <script language="JavaScript"> </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]文字颜色渐变(无闪屏) <script language="JavaScript"> </script> 文字颜色渐变(无闪屏) [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] <script language=javascript> function wh_10to16(n){ var a = new Array(16); a[0]="0";a[1]="1";a[2]="2";a[3]="3";a[4]="4";a[5]="5";a[6]="6";a[7]="7";a[8]="8";a[9]="9";a[10]="A";a[11]="B";a[12]="C";a[13]="D";a[14]="E";a[15]="F"; return a[parseInt(n/16)]+a[n%16] } function wh_TransbgMakeColor(r,g,b){ return wh_10to16(r)+wh_10to16(g)+wh_10to16(b); } function wh_TransbgGetColorInc(r1,r2){ if (r1 < r2) return 1; else if (r1 > r2) return -1; else return 0; } function wh_changebg() { var r = wh_TransbgR1; var g = wh_TransbgG1; var b = wh_TransbgB1; wh_TransbgR1 += wh_TransbgGetColorInc(wh_TransbgR1,wh_TransbgR2)*wh_TransbgSpeed; wh_TransbgG1 += wh_TransbgGetColorInc(wh_TransbgG1,wh_TransbgG2)*wh_TransbgSpeed; wh_TransbgB1 += wh_TransbgGetColorInc(wh_TransbgB1,wh_TransbgB2)*wh_TransbgSpeed; if ((r-wh_TransbgR2)*(wh_TransbgR1-wh_TransbgR2) <=0 ) wh_TransbgR1 = wh_TransbgR2; if ((g-wh_TransbgG2)*(wh_TransbgG1-wh_TransbgG2) <=0 ) wh_TransbgG1 = wh_TransbgG2; if ((b-wh_TransbgB2)*(wh_TransbgB1-wh_TransbgB2) <=0 ) wh_TransbgB1 = wh_TransbgB2; document.bgColor=wh_TransbgMakeColor(wh_TransbgR1 ,wh_TransbgG1 ,wh_TransbgB1); if (wh_TransbgR1==wh_TransbgR2 && wh_TransbgG1==wh_TransbgG2 && wh_TransbgB1==wh_TransbgB2){ if ((++wh_TransbgIndex) >= wh_TransbgTotal-1) { if (!wh_TransbgLoop && wh_TransbgCount==1) return; wh_TransbgCount++; wh_TransbgIndex=0; } wh_TransbgR1 =wh_TransbgColorsR[wh_TransbgIndex]; wh_TransbgG1 =wh_TransbgColorsG[wh_TransbgIndex]; wh_TransbgB1 =wh_TransbgColorsB[wh_TransbgIndex]; wh_TransbgR2 =wh_TransbgColorsR[wh_TransbgIndex+1]; wh_TransbgG2 =wh_TransbgColorsG[wh_TransbgIndex+1]; wh_TransbgB2 =wh_TransbgColorsB[wh_TransbgIndex+1]; } setTimeout("wh_changebg()", 1); } wh_TransbgR1=0; wh_TransbgG1=0; wh_TransbgB1=0; wh_TransbgR2=0; wh_TransbgG2=0; wh_TransbgB2=0; wh_TransbgSpeed=1; wh_TransbgLoop=true; wh_TransbgTotal=4; wh_TransbgIndex =wh_TransbgTotal-1; wh_TransbgColorsR = new Array(wh_TransbgTotal); wh_TransbgColorsG = new Array(wh_TransbgTotal); wh_TransbgColorsB = new Array(wh_TransbgTotal); wh_TransbgColorsR[0]=255; wh_TransbgColorsG[0]=240; wh_TransbgColorsB[0]=230; wh_TransbgColorsR[1]=230; wh_TransbgColorsG[1]=255; wh_TransbgColorsB[1]=240; wh_TransbgColorsR[2]=240; wh_TransbgColorsG[2]=230; wh_TransbgColorsB[2]=255; wh_TransbgColorsR[3]=255; wh_TransbgColorsG[3]=240; wh_TransbgColorsB[3]=230; wh_TransbgCount=0; wh_changebg(); </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容