网页特效:色彩变幻的链接

网页特效:色彩变幻的链接,第1张

网页特效:色彩变幻的链接,第2张

色彩自动变换的链节,效果很赞,就是代码比较长。

  
  
  Dynamic Link Color Changer
  
  <script Language="Javascript">
  bname=navigator.appName;
  bversion=parseInt(navigator.appVersion)
  var z=0;
  var rgb=0;
  var message= new Array();
  var value=0;
  var timer1;
  var timer2;
  var timer3;
  var convert = new Array()
  var hexbase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
  //Do not edit anything else in the script except the lines below
  var bgcolor="#FF0000"; //Fade color
  var color="#0000FF"; //Starting color
  var speed=55
  //Do not edit anything else in the script except the lines above
  for (x=0; x<16; x++){
   for (y=0; y<16; y++){
   convert[value]= hexbase[x] + hexbase[y];
   value++;
   }
  }
  redx=color.substring(1,3);
  greenx=color.substring(3,5);
  bluex=color.substring(5,7);
  hred=eval(parseInt(redx,16));
  hgreen=eval(parseInt(greenx,16));
  hblue=eval(parseInt(bluex,16));
  eredx=bgcolor.substring(1,3);
  egreenx=bgcolor.substring(3,5);
  ebluex=bgcolor.substring(5,7);
  ered=eval(parseInt(eredx,16));
  egreen=eval(parseInt(egreenx,16));
  eblue=eval(parseInt(ebluex,16));
  red=ered;
  green=egreen;
  blue=eblue;
  function start(){
   timer1=window.setInterval('up()',speed)
  }
  function up(){
   if (red   if ((red+15)   red+=15;
   redx = convert[red]
   }
   else{
   red=hred
   redx = convert[red]
   }
   }
   if (red>hred){
   if ((red-15)>hred){
   red-=15;
   redx = convert[red]
   }
   else{
   red=hred
   redx = convert[red]
   }
   }
   if (green   if ((green+15)   green+=15;
   greenx = convert[green]
   }
   else{
   green=hgreen
   greenx = convert[green]
  }
   }
   if (green>hgreen){
   if ((green-15)>hgreen){
   green-=15;
   greenx = convert[green]
   }
   else{
   green=hgreen
   greenx = convert[green]
   }
   }
   if (blue   if ((blue+15)   blue+=15;
   bluex = convert[blue]
   }
   else{
   blue=hblue
   bluex = convert[blue]
   }
   }
   if (blue>hblue){
   if ((blue-15)>hblue){
   blue-=15;
   bluex = convert[blue]
   }
   else{
   blue=hblue
   bluex = convert[blue]
   }
   }
   rgb = "#"+redx+greenx+bluex;
   document.linkColor=rgb;
   document.vlinkColor=rgb;
   if (z>19){
   window.clearInterval(timer1);
   timer2=window.setInterval('down()',speed)
   }
   else
   z++
  }

位律师回复
DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
白度搜_经验知识百科全书 » 网页特效:色彩变幻的链接

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情