
I have this Fade Javascript that works quite well, but
I need to do 2 things to it.
1) I wish for the background color to appear immediately with
the text. The Background Color ONLY appears with mouseover.
In other words, only the text is there at the start, I want the
BackgroundColor #134c39 to be there with it.
2) How do I increase the SPEED of the FADE process, it's
TOO SLOW for me.
Here's the Fade Script:
<script type = "text/javascript">
var fmTimer = null;
function fminit(){
if (!document.getElementById) return;
fma1=0xFF; fma2=0xFF; fma3=0xFF;
fma4=0x00; fma5=0x00; fma6=0x00;
fmb1=0x13; fmb2=0x4c; fmb3=0x39;
fmb4=0x00; fmb5=0x99; fmb6=0x99;
fmFade();
}
function fmToHex(n){
var hexChars = "0123456789ABCDEF";
if (n == 0) return "00";
var j, n;
var temp = "";
while (n != 0){
j = n % 16;
n = (n - j)/16;
temp = hexChars.charAt(j) + temp;
}
if (temp.length < 2){
temp = "0" + temp;
}
return temp;
}
function fmFade(){
obj = document.getElementById('tekst').style;
fmcolor = "#" + fmToHex(fma1) + fmToHex(fma2) + fmToHex(fma3);
obj.color = fmcolor;
if (fma1 != fma4){
if (fma4 > fma1){fma1++;}
else{fma1--;}}
if (fma2 != fma5){
if (fma5 > fma2){fma2++;}
else{fma2--;}}
if (fma3 != fma6){
if (fma6 > fma3){fma3++;}
else{fma3--;}}
fmbackcolor = "#" + fmToHex(fmb1) + fmToHex(fmb2) + fmToHex(fmb3);
obj.backgroundColor = fmbackcolor;
if (fmb1 != fmb4){
if (fmb4 > fmb1){fmb1++;}
else{fmb1--;}}
if (fmb2 != fmb5){
if (fmb5 > fmb2){fmb2++;}
else{fmb2--;}}
if (fmb3 != fmb6){
if (fmb6 > fmb3){fmb3++;}
else{fmb3--;}}
if ((fma1 == fma4) && (fma2 == fma5) && (fma3 == fma6) && (fmb1 == fmb4) && (fmb2 == fmb5) && (fmb3 == fmb6)){
window.clearTimeout(fmTimer);
}
else{
fmTimer = window.setTimeout("fmFade()",1);
}
}
</script>
<span id="tekst" style="font-size:16; font-family: Arial, Helvetica, sans-serif; letter-spacing:normal; font-weight:bold; font-style:normal; padding-left:14px; padding-right:14px;" onmouseover="fminit()">Mortgage</span>
The KRYPTOR
