SV650.org - SV650 & Gladius 650 Forum



Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).
There's also a "U" rating so please respect this. Newbies can also say "hello" here too.

Reply
 
Thread Tools
Old 25-05-07, 02:10 PM   #1
Skip
Member
Mega Poster
 
Skip's Avatar
 
Join Date: Feb 2005
Location: Norfolk
Posts: 3,151
Default 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
__________________
'81 Honda H100A
'18 Honda MSX125 (Grom)
Skip is offline   Reply With Quote
Old 25-05-07, 02:21 PM   #2
Kinvig
Guest
 
Posts: n/a
Default Re: Javascript Help...

stupid question:

Say the user does not have javascript enabled?

also, say they're blind? i.e. with a text reader?
  Reply With Quote
Old 25-05-07, 02:23 PM   #3
Skip
Member
Mega Poster
 
Skip's Avatar
 
Join Date: Feb 2005
Location: Norfolk
Posts: 3,151
Default Re: Javascript Help...

Then it wont work

The menu system works in the same way - its a risk I will take until I become a CSS expert
__________________
'81 Honda H100A
'18 Honda MSX125 (Grom)
Skip is offline   Reply With Quote
Old 25-05-07, 03:27 PM   #4
snackbar
Guest
 
Posts: n/a
Default 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
  Reply With Quote
Old 25-05-07, 04:58 PM   #5
robaker
Guest
 
Posts: n/a
Default Re: Javascript Help...

hex=hcolor.toString(16);
if (hex.length==1) hex="0" + hex;
obj.style.color="#" + hex + hex + "FF";
  Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:50 AM.


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