/    Sign up×
Community /Pin to ProfileBookmark

modify script please

can someone tell me how to modify this script so it only higlights in red ?

[code=php]
IE = (document.all);
if (IE) {
var chidc = new Array();
var hexc = new Array(‘0′,’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′,’A’,’B’,’C’,’D’,’E’,’F’);
var chidn = new Array(100,70,40);
var step = new Array(10,10,10);
var chway = new Array(step[0],step[1],step[2]);
var tone = new Array(1,1,1);
function chcol() {
for (i=0; i<3; i++) {
chidn[i]+=chway[i];
if (chidn[i]>=255) {
chidn[i] = 255;
chway[i] = -step[i];
}
else if (chidn[i]<=40) {
chidn[i] = 40;
chway[i] = step[i];
tone[i]>=3? tone[i] = 1:tone[i]++;
}
col1 = hexc[Math.floor(chidn[i]/16)];
col2 = hexc[chidn[i]%16];
tored = ”;
toblue = ”;
for (j=1; j<tone[i]; j++) tored+=’00’;
for (j=3; j>tone[i]; j–) toblue+=’00’;
chidc[i] = ‘#’+tored+col1+col2+toblue;
td = eval(‘document.all.chcol’+i);
td.style.backgroundColor = chidc[i];
}
setTimeout(‘chcol()’,0);
}
}
[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@7studNov 23.2004 — What? ?
<i>
</i>IE = (document.all);
if (IE)
{
function chcol()
{
for (i=0; i&lt;3; i++)
{
document.getElementById("chcol" + i).style.backgroundColor="red";
}
}

<i> </i>chcol();
}
Copy linkTweet thisAlerts:
@gert_cuykensauthorNov 23.2004 — if you test it you will see it changes color and i would like to have the same color.
×

Success!

Help @gert_cuykens spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...