開閉パネルを設定する

書式

cpObj = new Spry.Widget.CollapsiblePanel(cpID)

cpObj : パネルオブジェクト
cpID : 開閉パネル全体を囲むdivタグのID

説明

折りたたみ可能な開閉パネルを設定するにはSpry.Widget.CollapsiblePanel()を使います。最初のパラメータに折りたたみ可能なパネル全体を囲むdivタグのIDを指定します。折りたたみ可能なパネルが正しく生成されるとパネルオブジェクトが返されます。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="SpryCollapsiblePanel.css" type="text/css" media="all">
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<script src="SpryCollapsiblePanel.js" type="text/javascript"></script>
<script type="text/javascript"><!--
window.onload = function() {
new Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
}
// --></script>
</head>
<body>
<h1>Adobe Spry : Collapsibleサンプル</h1>
<div id="CollapsiblePanel1" class="CollapsiblePanel">
<div class="CollapsiblePanelTab">CollapsiblePanelとは?</div>
<div class="CollapsiblePanelContent">
<p>折りたたみ可能な開閉パネルです。</p>
</div>
</div>
</div>
</body>
</html>