类似功放上的Spectrum的PHP+Javascript程序
<?
  $bar_height
=5;
  
$bar_width=20;
  
$bar_height_number=10;//建议不要改得太大,不然机器吃不消
  
$bar_width_number=10;//建议不要改得太大,不然机器吃不消
  
$bar_body_color="#425DB5";
  
$bar_peek_color="#FF8200";
  
  
$border_width=1;
  
$border_color="#000000";
  
$back_color="#333333";
  
$speed=200;
?>
<html>
<head>
<title>Spectrum</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
// *****************************************************************
//                   Written By Caocao
//                   [email protected]
//                   http://caocao.oso.com.cn
// *****************************************************************
  var current_peek=new Array(<? echo $bar_width_number;?>);

  function change(current_layer,on_off)
  {
    if (on_off==0)
    {
      current_layer.style.background="<? echo $back_color;?>";
    }
    if (on_off==1)
    {
      current_layer.style.background="<? echo $bar_body_color;?>";
    }
    if (on_off==2)
    {
      current_layer.style.background="<? echo $bar_peek_color;?>";
    }
  }
  
  function result(y,x)
  {
    if ((<? echo $bar_height_number;?>-y)>current_peek[x])
    {
      return (0);
    }
    if ((<? echo $bar_height_number;?>-y)<current_peek[x])
    {
      return (1);
    }
    if ((<? echo $bar_height_number;?>-y)==current_peek[x])
    {
      return (2);
    }
  }
  
  function result_peek()
  {
    for (i=0;i<<? echo $bar_width_number;?>;i++)
    {
      current_peek[i]=Math.round(Math.random()*<? echo $bar_height_number;?>);
    }
  }
  
  function show()
  {
    result_peek();
<?
  
for ($i=0;$i<$bar_height_number;$i++)
  {
    for (
$j=0;$j<$bar_width_number;$j++)
    {
      echo 
"change(w".$i."h".$j.",result(".$i.",".$j."));";
    }
  }
?>
    setTimeout("show()",<? echo $speed;?>);
  }
</script>
</head>
<body bgcolor="#000000">
<?
  
echo "<table width=".($bar_width*$bar_width_number)." border=".$border_width." cellspacing=0 cellpadding=0 align=center bordercolor=".$border_color.">";
  for (
$i=0;$i<$bar_height_number;$i++)
  {
    echo 
"<tr>";
    for (
$j=0;$j<$bar_width_number;$j++)
    {
      echo 
"<td><div id=w".$i."h".$j." style="position:relativewidth:".$bar_width."pxheight:".$bar_height."pxbackground:".$back_color."font-size:1px"></div></td>";//注意,其中有一些反斜杠+"有可能被oso过滤成"
    
}
    echo 
"</tr>";
  }
  echo 
"</table>";
?>
<script language="javascript">
  show();
</script>
</body>
</html>