・ ・ ・ ・ ・ ・ ・ ・ ・ ・  →前へ→次へトップへ戻る
その7. 新しい試み(2)テンプレートをもっと使いやすく!
・テンプレートが作りやすくなりました。
 複数行のHTMLテンプレートが記述できます!

結果のサンプル

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

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

ソース(スクリプト側) <HEAD>〜</HEAD>の中に入れましょう。
<SCRIPT>
function wopen7(files){
  new_window=window.open();
  new_window.focus();

  var newContent = "<html><head><title>sample</title></head>";
    newContent += "<body bgcolor=white>";
    newContent += "<TABLE border=1 cellpadding=\"10px\" cellspacing=\"0px\">";
    newContent += "<TR>";
    newContent += "<TD bgcolor=#333333>";
    newContent += "<B style=\"color:white;\">住居者フォトギャラリー</B>";
    newContent += "<HR noshade>";
    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>";
    newContent += "</html>";

  new_window.document.write(newContent);
  new_window.document.close();

	}
</SCRIPT>
 ・複数行のHTMLが書けます。
 ・HTMLでは、「"」の代わりに「\"」を使ってください。
ソース(呼び出し側) <BODY>〜</BODY>のどこかに入れましょう。
 <A href="javascript:wopen7('../image/sample_200x150_01.jpg')">
 	フォトギャラリー(1)
 </A>

※「その6」と一緒です。

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