Страница 1 из 1

Скрипт с меганием ячеек в таблице

СообщениеДобавлено: 19 авг 2008, 13:10
Апостол
Я нашел скрипт где ячейки в таблице перливаються цветами, но работает в ИЕ, а в Опере нет(мозилу не проверял), помогите пожалуйста сделать так чтобы и в Опере тоже работало!
Спойлер: Показать +
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
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()',100);
}
}
// End -->
</script>
</head>
<body background="background1.gif" link="#000000" text="#000000">
<center>
<li><a href="http://web-script.narod.ru" target="_blank"><b>Web-Script</b></a></li>

<table cellspacing=2 cellpadding=0 bgcolor=#999999 width=300>
<tr>
<td width=33% align=center id=chcol0 name=id=chcol0>
<font color=white>Left</td>
<td width=33% align=center id=chcol1 name=id=chcol0>
<font color=white>To</td>
<td width=33% align=center id=chcol2 name=id=chcol0>
<font color=white>Right</td>
</tr>
</table>
</center>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
chcol();
// End -->
</script>
</body>
</html>

мммм...вот архив с этим скриптом, где показано как он работает
надеюсь на вашу помощь :) ;)

Re: Скрипт с меганием ячеек в таблице

СообщениеДобавлено: 24 авг 2008, 16:58
Vanofuture
Код: Выделить всё
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
chidc = new Array();
hexc = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
chidn=new Array(100,70,40);
step = new Array(10,10,10);
chway = new Array(step[0],step[1],step[2]);
tone = new Array(1,1,1);
function chcol() {
for (i=0; i<3; i++) {
chidn[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()',100);
}
// End -->
</script>
</head>
<body background="background1.gif" link="#000000" text="#000000">
<center>
<li><a href="http://web-script.narod.ru" target="_blank"><b>Web-Script</b></a></li>

<table cellspacing=2 cellpadding=0 bgcolor=#999999 width=300>
<tr>
<td width=33% align=center id=chcol0 name=id=chcol0>
<font color=white>Left</td>
<td width=33% align=center id=chcol1 name=id=chcol0>
<font color=white>To</td>
<td width=33% align=center id=chcol2 name=id=chcol0>
<font color=white>Right</td>
</tr>
</table>
</center>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
chcol();
// End -->
</script>
</body>
</html>

Re: Скрипт с меганием ячеек в таблице

СообщениеДобавлено: 24 авг 2008, 18:07
Апостол
Vanofuture
Спасибо Огромное...Работает..жаль здесь нет репы :(