JavaScript

Сведения о системе
Часы
Эквалайзер
Текст в поле формы
Цветной фон
Goodbye окно
MultiLink
Размер окна
MultiLink-II

DHTML


Книги

English | Главная


Полезные ссылки:








Эквалайзер | Описание

Если Вы хотите использовать любой из наших примеров, поставьте на нас ссылку.
Здесь Вы можете взять готовый HTML-код для такой ссылки.

<html>
<head>
<script language="JavaScript">
<!--
color=new Array();
color[0]="green.gif";
color[1]="green.gif";
color[2]="green.gif";
color[3]="green.gif";
color[4]="green.gif";
color[5]="green.gif";
color[6]="green.gif";
color[7]="green.gif";
color[8]="green.gif";
color[9]="green.gif";

h=new Array();
for(var i=0;i<10;i++)
  h[i]=-1;

function d_rand()
{
  for(var i=0;i<10;i++)
  {
    var h_old=h[i];
    var sgn=1;
    var rndm=0;
    if(h[i]==-1)
    {
      h[i]= Math.floor(Math.random()*10)
      h_old=9;
    }
    else
    {
      rndm=Math.floor(Math.random()*3);
      sgn=Math.floor(Math.random()*2);
      if(sgn==0)
      {
        var h_old=h[i]
        h[i]+=rndm;
        if(h[i]>9) 
          h[i]=9;
      }
      else
      {
        var h_old=h[i]
        h[i]-=rndm;
        if(h[i]<0) 
          h[i]=0;
      }
    }
    if(sgn==0)
    {
      for(var j=h_old;j<=h[i];j++)
        document.images[i+j*10].src = "black.gif";          
    }
    else
    {
      for(var j=h_old;j>=h[i];j--)
        document.images[i+j*10].src = color[i];          
    }

  }    
  timerId=setTimeout("d_rand()",70)
}
//-->
</script>
<title>www.redmount.com - JavaScript - Эквалайзер</title>
</head>

<body bgcolor="Black" leftmargin=30 text="White" marginwidth=30 vlink=silver>

<table border="0" cellspacing="0" cellpadding="1" >
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<tr> 
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
<td><img src="black.gif" width=20 height=10></td>
</table><br>

<form name=diagram>
<input name=random type=button value="Play >" onClick="d_rand()">
</form>

</body>
</html>