前面に表示する

書式

 windowObj.toFront()

windowObj :ウィンドウオブジェクト

説明

 ウィンドウを前面に表示するにはtoFront()を使います。

サンプルコード [実行]

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="default.css" type="text/css" media="all">
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="effects.js"></script>
<script type="text/javascript" src="window.js"></script>
<script type="text/javascript"><!--
var win01, win02;
window.onload = function(){
win01 = new Window("win01", {
title: "ウィンドウ01", className: "dialog", top:100, left:10, zIndex: 100,
width:320, height:240, resizable: true, draggable:true });
win01.setDestroyOnClose();
win01.show();

win02 = new Window("win02", {
title: "ウィンドウ02", className: "dialog", top:150, left:180, zIndex: 101,
width:320, height:240, resizable: true, draggable:true });
win02.setDestroyOnClose();
win02.show();
}
function toFront(){
win01.toFront();
}
// --></script>
</head>
<body>
<h1>前面に表示する</h1>
<form>
<input type="button" value="ウィンドウ01を前面に表示" onClick="toFront()">
</form>
</body>
</html>