親からサブウィンドウの画像を切り替え

サブウィンドウの画像を切り替えます・・・→ 熊クン/ ワンちゃん/ 忍者ちゃん

Sample Source......................................................................>>>

<SCRIPT language="JavaScript"><!--
  var subw = "";
  function WinOpen(){
     subw = window.open('','win2','width=250,height=100');
     SubOpen();
  }
  function SubOpen(){
      subw.document.open();
      subw.document.write("<p>・・・</p>熊クンで〜ス!     ");
      subw.document.write("<img src='../../images/anime/kuma01.gif'>");
      subw.document.bgColor = "black";
      subw.document.fgColor = "pink";
      subw.document.close();
      subw.document.focus();
  }
 function AnimeChange(n,pic){
    if(subw.closed)subw = window.open('','win2','width=250,height=100');    
    subw.document.open();
     if(n==1)msg = "<p>・・・</p>熊クンで〜ス!";
     if(n==2)msg = "<p>・・・</p>ワンちゃんで〜ス!";
     if(n==3)msg = "忍者チャンで〜ス!";
    subw.document.write(msg);
    subw.document.write("<img src='../../images/anime/" + pic + ".gif'>");
    subw.document.bgColor = "black";
    subw.document.fgColor = "pink";
    subw.document.close();
    subw.window.focus();
 }
//--></SCRIPT>
</head>

<body>
<button onclick="WinOpen();">サブウィンドウを開く</button>
<form name="form1">
  サブウィンドウの画像を切り替えます・・・→
 <input type="radio" name="anime" onclick="AnimeChange(1,'kuma01');" checked>熊クン/ 
  <input type="radio" name="anime" onclick="AnimeChange(2,16);">ワンちゃん/ 
  <input type="radio" name="anime" onclick="AnimeChange(3,'ninjya');">忍者ちゃん
</form>

(最終更新:12/12/8)
フレーム構成になっています・・・<[ホーム] >> [HTML整理ノート]>