Ver Mensaje Individual
  #8 (permalink)  
Antiguo 16/10/2003, 11:35
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 4 meses
Puntos: 61

Y con lo que has puesto prueba a ver si funciona esto...

Código PHP:
/*************
**** <config>
**/

startColor "#002e59"// initial link color
endColor "#ffffff";  // final link color

stepIn 17// delay when fading in
stepOut 17// delay when fading out

/*
** set to true or false; true will
** cause all links to fade automatically
***/
autoFade false;  

/*
** set to true or false; true will cause all CSS
** classes with "fade" in them to fade onmouseover
***/
sloppyClass true

hexa = new makearray(16);
for(var 
010i++)
    
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();

function 
dehexize(Color){
    var 
colorArr = new makearray(3);
    for (
i=1i<7i++){
        for (
j=0j<16j++){
            if (
Color.charAt(i) == hexa[j]){
                if (
i%!=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){
      var 
srcElement event.srcElement;
      if ((
autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
        
fade(startColor,endColor,srcElement.uniqueID,stepIn);      
   }
}

function 
domouseout() {
  if (
document.all){
      var 
srcElement event.srcElement;
    if ((
autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
        
fade(endColor,startColor,srcElement.uniqueID,stepOut);
    }
}

function 
makearray(n) {
    
this.length n;
    for(var 
1<= ni++)
        
this[i] = 0;
    return 
this;
}

function 
hex(i) {
    if (
0)
        return 
"00";
    else if (
255)
        return 
"ff";
    else
       return 
"" hexa[Math.floor(i/16)] + hexa[i%16];}

function 
setColor(rgbelement) {
      var 
hr hex(r); var hg hex(g); var hb hex(b);
      
element.style.color "#"+hr+hg+hb;
}

function 
fade(s,eelement,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 
1;
        while(
fadeId.length){
            
clearTimeout(fadeId[i]);
            
i++;
            }
        }
        
    for(var 
0<= stepi++) {
        
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;

__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.

Última edición por KarlanKas; 16/10/2003 a las 11:42