palette.htm

戻る

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML LANG="ja">

<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=Shift_JIS">
<TITLE>パレット アニメーションもどき</TITLE>
</HEAD>

<BODY BGCOLOR="#CCFFFF">
<BR><BR><BR>
<CENTER>
<DIV STYLE="position:relative; width:407; height:120">
<IMG ID="img1" SRC="images/palette1.gif" WIDTH=178 HEIGHT=120 STYLE="position:absolute; left:0; top:0; background-color:#0099FF">
<IMG ID="img2" SRC="images/palette2.gif" WIDTH=229 HEIGHT=120 STYLE="position:absolute; left:178px; top:0; background-color:#FFCC00">
</DIV>
</CENTER>

<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--

function timer() {
  if(ud1) {
    if(--g1 == 0x99)
      ud1 = 0;
  }
  else {
    if(++g1 == 0xff)
      ud1 = 1;
  }
  document.getElementById("img1").style.backgroundColor = "rgb(0," + String(g1) + "," + String(0x198 - g1) + ")";

  if(ud2) {
    if(--g2 == 0xcc)
      ud2 = 0;
  }
  else {
    if(++g2 == 0xff)
      ud2 = 1;
  }
  document.getElementById("img2").style.backgroundColor = "rgb(" + String(0x1cb - g2) + "," + String(g2) + ",0)";
}

  g1 = 0x99;
  g2 = 0xcc;
  ud1 = ud2 = 0;
  setInterval(timer, 50);

//-->
</SCRIPT>

</BODY>

</HTML>