jQueryEasyUI Accordion의 기본 사용

17567 단어 accordion
html 코드:
<div id="menu">
<div title="Title1">
content1
</div>
<div title="Title2">
content2
</div>
<div title="Title3">
content3
</div>
</div>

1、accordion
<link type="text/css" rel="stylesheet" href="jquery-easyui-1.2.3/themes/default/easyui.css">
<link type="text/css" rel="stylesheet" href="jquery-easyui-1.2.3/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.2.3/jquery-1.6.2.min.js">
<script type="text/javascript" src="jquery-easyui-1.2.3/jquery.easyui.min.js">
<script type="text/javascript" src="jquery-easyui-1.2.3/locale/easyui-lang-zh_CN.js">
<script type="text/javascript">
$(
function () {
$(
"#menu").accordion();
});
</script>

2. accordion의 Width, Height 설정
<script type="text/javascript">
$(
function () {
$(
"#menu").accordion({
width:
300,
height:
300,
});
});
</script>

3. select 설정 accordion 현재pannel
<script type="text/javascript">
$(
function () {
$(
"#menu").accordion({
width:
300,
height:
300,
});

$(
"#menu").accordion("select", "Title2");
});
</script>

4、fit
fit가true일 때 width 및 height가 올바르지 않습니다
<script type="text/javascript">
$(
function () {
$(
"#menu").accordion({
fit:
true
});
});
</script>

또는
<div id="menu" fit="true">
<div title="Title1">
content1
</div>
<div title="Title2">
content2
</div>
<div title="Title3">
content3
</div>
</div>

5、border
accordion 경계선border 취소
<div id="menu" border="false">
<div title="Title1">
content1
</div>
<div title="Title2">
content2
</div>
<div title="Title3">
content3
</div>
</div>

6、panel icon
<div id="menu">
<div title="Title1" iconCls="icon-ok">
content1
</div>
<div title="Title2">
content2
</div>
<div title="Title3">
content3
</div>
</div>

7、accordionpanel 추가
$("#menu").accordion("add",{
title:
"New Title",
content:
"New Content",
iconCls:
"icon-ok"
});

8, accordionpanel 삭제
var pnl = $("#menu").accordion("getSelected");
if (pnl)
{
var title = pnl.panel("options").title;
$(
'#aa').accordion("remove",title);
}

좋은 웹페이지 즐겨찾기