・ ・ ・ ・ ・ ・ ・ ・ ・ ・  →前へ→次へトップへ戻る
その8. 新しい試み(3)いろいろできるテンプレート!
・テンプレートが使いやすくなりました!
 画像や、文字や、背景色が指定できます!
 サイズも指定できます!
・もちろん、複数行のHTMLで記述できます!

結果のサンプル

 →フォトギャラリー(1)
 →フォトギャラリー(2)
 →フォトギャラリー(3)

  ※すべて同じスクリプトを使って表示しています。

ソース(スクリプト側) <HEAD>〜</HEAD>の中に入れましょう。
<SCRIPT>
function wopen7(files,texts,bgcol,w_width,w_height){
 detail="width="+w_width+",height="+w_height+",scrollbars=no, menuber=no";
 new_window=window.open();
 new_window.focus();

 var newContent = "<html><head><title>sample</title></head><body bgcolor=white>";
  newContent += "<TABLE border=1 cellpadding=\"10px\" cellspacing=\"0px\">";
  newContent += "<TR>";
  newContent += "<TD bgcolor="+bgcol+">";
  newContent += "<B style=\"color:white;\">住居者フォトギャラリー</B>";
  newContent += "<HR noshade color=white>";
  newContent += "<SPAN style=\"font-size:9pt;color:white;\">";
  newContent += texts+"<BR>"+texts+"<BR>"+texts;
  newContent += "</SPAN>";
  newContent += "<BR><BR><BR>";
  newContent += "<SPAN style=\"font-size:8pt;color:white;\">"+files+"</SPAN>";
  newContent += "</TD><TD>";
  newContent += "<IMG src="+files+">";
  newContent += "</TD>";
  newContent += "</TR>";
  newContent += "</TABLE><BR>";
  newContent += "<SMALL>※すべて同じスクリプトで表示しています。</SMALL>";
  newContent += "</body></html>";
 new_window.document.write(newContent);
 new_window.document.close();

 }
</SCRIPT>
 ・テンプレートは、単純なHTMLなので、自分好みにカスタマイズしましょう。
ソース(呼び出し側) <BODY>〜</BODY>のどこかに入れましょう。
  <A href="javascript:wopen8(
   '../image/sample_200x150_01.jpg','えろ医者でございます。','#995555',
   '450px','250px')">
    フォトギャラリー(1)
  </A>
※「その6」と一緒です。

・・・・・・・・・・>もどる。