| このページ最下部の実行するで確認できます |
| 項目 | スタイル | 値 | 意 味 |
| バ | の 表 示 |
|||
| location= | yes|no | 場所ツールバーの表示 | |
| menubar= | yes|no | メニューバーの表示 | |
| scrollbars= | yes|no | スクロールバーの表示 | |
| status= | yes|no | ステータスバーの表示 | |
| toolbar= | yes|no | ツールバーの表示 | |
| titlebar= | yes|no | タイトルバーの表示 セキュリティの設定が必要 | |
| 大 き さ |
|||
| width= | pixe | ウィンドウの横幅 | |
| height= | pixe | ウィンドウの高さ | |
| fullscreen= | yes|no | フルスクリーンモードで開く 閉じるには ALT+F4 を使う | |
| resizable= | yes|no | ウィンドウのサイズ変更の可否 | |
| 位 置 |
|||
| top= | pixe | 画面の上端からの距離 | |
| left= | pixe | 画面の左端からの距離 | |
| そ の 他 |
|||
| channelmode= | yes|no | チャネルモードで開く | |
| directories= | yes|no | ユーザ設定ツールバーの表示 |
☆ 新しいウィンドウを開く function nw_open()[例] w=window.open(winurl,"calen",w_para)
|
| function nw_open() |
function nw_open()
{
winurl = 'dumy.html';
w_para="toolbar=no,location=no,directries=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,top=200,left=100" ;
w=window.open(winurl,"calen",w_para);
}
|
| dumy.html |
<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=x-sjis"> <TITLE>Body</TITLE> </HEAD> <body bgcolor=red> </BODY> </html> |
| 実行する |
★ 内容の書き換え function re_w() |
function re_w()
{
w.document.clear() ;
w.document.open() ;
w.document.write("<HTML>") ;
w.document.write("<HEAD>") ;
w.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=x-sjis\">") ;
w.document.write("<TITLE>New Window</TITLE>") ;
w.document.write("</HEAD>") ;
w.document.write("<body bgcolor=green text=white>") ;
w.document.write("<h1>背景を緑にした<h1>") ;
w.document.write("</BODY>") ;
w.document.write("</html>") ;
w.document.close() ;
}
|
| 実行する |
★ ウィンドウサイズの変更 function re_size()400X300を400x500に変更 |
function re_size()
{
w.resizeTo(400,500) ;
}
|
| 実行する |
★ 相対値でのサイズの変更 function re_size_so()横幅を400大きく、高さを100小さく変更 |
function re_size_so()
{
w.resizeBy(400,-100) ;
}
|
| 実行する |
★ ウィンドウの移動 function w_move()ウィンドウの左上を(400,300)に移動 |
function w_move()
{
w.moveTo(400,300) ;
}
|
| 実行する |
★ 相対値での移動 function w_move_so()左に400大きく、下に300移動 |
function w_move_so()
{
w.moveBy(400,300) ;
}
|
| 実行する |
★ ウィンドウを閉じる function w_close() |
function w_close()
{
w.close() ;
}
|
| 実行する |
☆ ファイル全体 nw.html |
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=x-sjis">
<TITLE>New Window</TITLE>
<SCRIPT language="JavaScript1.2">
function nw_open()
{
winurl = 'dumy.html';
w_para="toolbar=no,location=no,directries=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,top=200,left=100" ;
w=window.open(winurl,"calen",w_para);
}
function re_w()
{
w.document.clear() ;
w.document.open() ;
w.document.write("<HTML>") ;
w.document.write("<HEAD>") ;
w.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=x-sjis\">") ;
w.document.write("<TITLE>New Window</TITLE>") ;
w.document.write("</HEAD>") ;
w.document.write("<body bgcolor=green text=white>") ;
w.document.write("<h1>背景を緑にした<h1>") ;
w.document.write("</BODY>") ;
w.document.write("</html>") ;
w.document.close() ;
}
function re_size()
{
w.resizeTo(400,500) ;
}
function re_size_so()
{
w.resizeBy(400,-100) ;
}
function w_move()
{
w.moveTo(400,300) ;
}
function w_move_so()
{
w.moveBy(400,300) ;
}
function w_close()
{
w.close() ;
}
</SCRIPT>
</HEAD>
<body bgcolor=000000 text=ffffff link=ffffff vlink=ffffff alink=ff0000>
<a href="#" onClick="nw_open()"><font size=5>新しいウィンドウを開く</font></a><br>
<a href="#" onClick="re_w()"><font size=5>内容の書き換え</font></a><br>
<a href="#" onClick="re_size()"><font size=5>ウィンドウサイズの変更</font></a><br>
<a href="#" onClick="re_size_so()"><font size=5>相対値でのサイズの変更</font></a><br>
<a href="#" onClick="w_move()"><font size=5>ウィンドウの移動</font></a><br>
<a href="#" onClick="w_move_so()"><font size=5>相対値での移動</font></a><br>
<a href="#" onClick="w_close()"><font size=5>ウィンドウを閉じる</font></a><br>
</BODY>
</html>
|
| dumy.html |
<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=x-sjis"> <TITLE>Body</TITLE> </HEAD> <body bgcolor=red> </BODY> </html> |
| 実行する |