書式
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 | |
| x | X座標 |
| y | Y座標 |
| xy | XY座標 |
| context | コンテキスト |
| fixedcenter | センタリング(trueまたはfalse) |
| width | 横幅 |
| height | 縦幅 |
| zIndex | Z座標 |
| 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="yui/yahoo.js"></script>
<script type="text/javascript" src="yui/dom.js"></script>
<script type="text/javascript" src="yui/event.js"></script>
<script type="text/javascript" src="yui/animation.js"></script>
<script type="text/javascript" src="yui/dragdrop.js"></script>
<script type="text/javascript" src="yui/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>