下のオプションを選択して、「F1」キーを押すと....
Windowオブジェクトのonhelpイベントハンドラ
<Script language="JavaScript"><!--
function F1(){
for(i=0 ; i<form1.help.length ; i++) { //チェックされているラジオボタンのvalue値を取得
if(form1.help[i].checked)v = form1.help[i].value;
}
if(v=="user"){
event.returnValue = false; //IE標準のヘルプを開かないようにする
userhelp = window.open('','helpwindow','width=420,height=360,left=200,top=100');
userhelp.document.write("<H4>ユーザー作成のヘルプ</H4><HR>");
userhelp.document.write("<P>●Internet Explorer標準のヘルプは開けないようにしました。<br> Internet Explorer標準のヘルプを開くにはラジオボタンで選択して下さい。</P>");
userhelp.document.write("<p>●windowオブジェクトのonhelpイベントハンドラを利用します。<br> このイベントハンドラのevent.returnValueプロパティに'false'を設定すれば、IE標準のヘルプは開かれず、 ユーザー独自の処理を行える。</p>");
userhelp.document.write("<HR><button onclick='self.close()'>閉じる</button>");
userhelp.document.bgColor = "black";
userhelp.document.fgColor = "white";
userhelp.document.close();
}
}
window.onhelp = F1;
//--></Script>
</head>
<body onload="window.focus()">
下のオプションを選択して、「F1」キーを押すと....
<form name="form1" style="color:brown;font:12px">
<input type="radio" name="help" value="ie">IE標準のヘルプを表示
<input type="radio" name="help" value="user" checked>ユーザー作成のヘルプを表示
</form>
end(01/12/28)