Colored Frames

colorString Value

<SCRIPT>

function setcolor(w) {
    
// Generate a random color
     var r = Math.
round(Math.random() * 256).toString(16);
     var g = Math.
round(Math.random() * 256).toString(16);
     var b = Math.
round(Math.random() * 256).toString(16);
     var colorString = "#" + r + g + b;

     // Set the frame background to the random color
    
w.document.bgColor = colorString;

    // Schedule another call to this method in one second. 
    // We can call the setTimeout() as a Method of the frame,
    // the string will be executed in that context,
    // so we must prefix properties of the top-level window with "parent."
   
// w.setTimeout("parent.setcolor(parent." + w.name + ")", 1000);

    // We could also have done the same thing more simply like this.
    setTimeout("setcolor(" + w.name + ")", 1000);

// NOTE: The name property of any Window object contains the name of that window.
}

</SCRIPT>

</HEAD>

<FRAMESET onLoad="for (var i = 0; i < 9; i++) setcolor(frames[i]);" rows="33%, 33%, 34%">
     <
FRAMESET COLS="33%, 33%, 34%">
          <
FRAME NAME="f1">
          <
FRAME NAME="f2">
          <
FRAME NAME="f3">
     </
FRAMESET>
     <
FRAMESET COLS="33%, 33%, 34%">
          <
FRAME NAME="f4">
          <
FRAME NAME="f5">
          <
FRAME NAME="f6">
     </
FRAMESET>
     <
FRAMESET COLS="33%, 33%, 34%">
          <
FRAME NAME="f7">
          <
FRAME NAME="f8">
          <
FRAME NAME="f9">
     </
FRAMESET>
     <
NOFRAMES>
          <
BODY>
          </
BODY>
     </
NOFRAMES>
</
FRAMESET>

</HTML>