码迷,mamicode.com
首页 > 其他好文 > 详细

EasyUI系列学习(十一)-Accordion(分类)

时间:2016-02-22 22:04:59      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:

一、加载

1.class加载

<div class="easyui-accordion" style="width:300px;height:200px">
    <div title="accordion1">accordion1</div>
    <div title="accordion2">accordion2</div>
    <div title="accordion3">accordion3</div>
</div>
2.js加载
<div id="acdn" style="width:300px;height:200px">
    <div title="accordion1">accordion1</div>
    <div title="accordion2">accordion2</div>
    <div title="accordion3">accordion3</div>
</div>
<script>
    $(function () {
        $("#acdn").accordion({});
    });
</script>

生成的代码

技术分享

二、属性

<div id="acdn">
    <div title="accordion1">accordion1</div>
    <div title="accordion2">accordion2</div>
    <div title="accordion3">accordion3</div>
</div>
<script>
    $(function () {
        $("#acdn").accordion({
            width: 300,
            height: 200,
            border: true,
            //fit:true,
            //animate:true,
            //同时展开多个面板
            multiple: true,
            selected: 1
        });
    });
</script>

三、事件

<div id="acdn">
    <div title="accordion1">accordion1</div>
    <div title="accordion2">accordion2</div>
    <div title="accordion3">accordion3</div>
</div>
<script>
    $(function () {
        $("#acdn").accordion({
            width: 300,
            height: 200,
            onSelect: function (title, index) {
                console.log(title + "," + index);
            },
            onUnselect: function (title, index) {
                console.log(title + ":" + index);
            },
            onAdd: function (title, index) {
                console.log(title + ":" + index);
            },
            onBeforeRemove: function (title, index) {
                console.log(title + ":" + index + "");
            },
            onRemove: function (title, index) {
                console.log(title + ":" + index + "");
            },
        });
    });
</script>

四、方法

技术分享

五、新增属性

因为分类组件继承了panel属性,其具有selected和collapsible两个属性

EasyUI系列学习(十一)-Accordion(分类)

标签:

原文地址:http://www.cnblogs.com/2star/p/5208215.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!