書式
new LITBox(text, { type:"confirm", func:okFunc })
text : ダイアログ上に表示する文字
okFunc : OKボタンが押された時の処理
説明
確認ダイアログを表示するにはtypeオプションにconfirmを指定します。OKボタンがクリックされた場合に処理を行うにはfuncオプションに処理する関数を指定します。
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<link rel="stylesheet" href="litbox.css" type="text/css" media="all">
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="scriptaculous.js"></script>
<script type="text/javascript" src="litbox.js"></script>
<script type="text/javascript"><!--
function displayBox(){
new LITBox("送信しますか?", { type:"confirm", width:320, height:240,
func:function(){
alert("送信しました");
}
});
}
// --></script>
</head>
<body>
<h1>LITBOXサンプル</h1>
<form>
<input type="button" value="表示" onClick="displayBox()">
</form>
</body>
</html>