SV650.org - SV650 & Gladius 650 Forum

SV650.org - SV650 & Gladius 650 Forum (http://forums.sv650.org/index.php)
-   Idle Banter (http://forums.sv650.org/forumdisplay.php?f=116)
-   -   Javascript Help... (http://forums.sv650.org/showthread.php?t=90082)

Skip 25-05-07 02:10 PM

Javascript Help...
 
I am trying to get a fading text script into my website and although it works well, I cannot seem to change the colour - I have played around with all the settings to no avail - anyone able to help? I want it blue instead of black!

Code:

<script language="javascript">
var hcolor=255;
function Fade(direction) {
  obj=document.getElementById("head1");
  hcolor += direction;
  if (hcolor >= 0 && hcolor < 256) {
      hex=hcolor.toString(15);
      if (hex.length==1) hex="0" + hex;
      obj.style.color="#" + hex + hex + hex;
      window.setTimeout("Fade(" + direction + ");",1);
  }
}
</script>
<body onLoad="Fade(-1);">

Anyone, whilst I keep hammering Google! ;)

Cheers

Kinvig 25-05-07 02:21 PM

Re: Javascript Help...
 
stupid question:

Say the user does not have javascript enabled?

also, say they're blind? i.e. with a text reader?

Skip 25-05-07 02:23 PM

Re: Javascript Help...
 
Then it wont work :lol:

The menu system works in the same way - its a risk I will take until I become a CSS expert ;)

snackbar 25-05-07 03:27 PM

Re: Javascript Help...
 
You could try a javascript forum - only a guess but i'm presuming there are a few more experts over there.

http://forums.digitalpoint.com/forumdisplay.php?f=38

robaker 25-05-07 04:58 PM

Re: Javascript Help...
 
hex=hcolor.toString(16);
if (hex.length==1) hex="0" + hex;
obj.style.color="#" + hex + hex + "FF";


All times are GMT. The time now is 10:58 AM.

Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.