パネルの各種設定を行う

書式

panelObject = new YAHOO.widget.Panel(element, config)

panelObject : パネルオブジェクト
element : パネルにするページ上のエレメント (divタグ)
config : パネル設定

説明

 パネルの各種設定を行うにはYAHOO.widget.Panel()の2番目のパラメータにプロパティリストの形式で指定します。以下のものが設定できます。

closeクローズボタン(trueまたはfalse)
draggableドラッグ可能かどうか(trueまたはfalse)
underlayパネルの影(shadow, none, matte)
modalモーダルモード(trueまたはfalse)
keylistenersキーリスナー(null, 配列で指定)
visible表示状態(trueまたはfalse)
effect表示/非表示時のエフェクト
monitorresize
xX座標
yY座標
xyXY座標
contextコンテキスト
fixedcenterセンタリング(trueまたはfalse)
width横幅
height縦幅
zIndexZ座標
constraintoviewport
iframe

サンプルコード [実行]

<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="css/container.css" type="text/css" media="all">
<script type="text/javascript" src="yahoo.js"></script>
<script type="text/javascript" src="dom.js"></script>
<script type="text/javascript" src="event.js"></script>
<script type="text/javascript" src="animation.js"></script>
<script type="text/javascript" src="dragdrop.js"></script>
<script type="text/javascript" src="container.js"></script>
<script type="text/javascript"><!--
window.onload = function(){
var panelObj = new YAHOO.widget.Panel("panel1", {
width:"320px",
height:"200px",
fixedcenter: true,
constraintoviewport: true,
underlay:"shadow",
close:false,
visible:false,
draggable:true
});
panelObj.render();
panelObj.show();
}
// --></script>
</head>
<body>
<h1>パネル</h1>
<div id="panel1">
<div class="hd">使用上の注意</div>
<div class="bd">本書の使用にあたってはライブラリのバージョンに注意する必要があります。</div>
<div class="ft">2006 (c) KaZuhiro FuRuhata</div>
</div> </body>
</html>