惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

博客园 - sunfishlu

一步一步学习Windows Azure(二)Azure之Hello World 一步一步学习Windows Azure(一)概述 一步一步学习CakePHP(三)model 一步一步学习CakePHP(二)controllers 一步一步学习CakePHP(一)基本概念 JQuery写的个性导航菜单 - sunfishlu - 博客园 JQueryUI(五):Dialog(第二部分) JQueryUI(四):Dialog(第一部分) - sunfishlu - 博客园 JQueryUI(二):Tabs(第二部分) JQueryUI(一):Tabs(第一部分) - sunfishlu - 博客园 封装的Ext Grid javascript与dom编程(五)ajax 无法在Web服务器上启动调试。您不具备调试此应用程序的权限,此项目的URL位于Internet区域。 - sunfishlu - 博客园 ToolTip(图片文字) with Jquery Ext中combobox在Grid里显示问题 javascript与dom编程(四)animation(例)Tooltips javascript与dom编程(三)animation extjs grid设置某列背景颜色 javascript与dom编程(二)Event
JQueryUI(三):Accordion
sunfishlu · 2009-09-25 · via 博客园 - sunfishlu

摘要:JQueryUI(Accordion)

1:Accordion的结构,首先我们先看一个基本的例子。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>A basic accordion implementation</title>
    <link href="../css/redmond/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/redmond/ui.accordion.css" />
    <script type="text/javascript" src="../jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../ui/ui.core.js"></script>
    <script type="text/javascript" src="../ui/ui.accordion.js"></script>
    <script type="text/javascript">
            $(document).ready(function () {
               $("#accordion").accordion({ header: "h3" });
            });
    </script>
    <style type="text/css">
        body
        {
            font: 62.5% "Trebuchet MS" , sans-serif;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div id="accordion">
        <div>
            <h3>
                <a href="#">First</a></h3>
            <div>
                Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
        </div>
        <div>
            <h3>
                <a href="#">Second</a></h3>
            <div>
                Phasellus mattis tincidunt nibh.</div>
        </div>
        <div>
            <h3>
                <a href="#">Third</a></h3>
            <div>
                Nam dui erat, auctor a, dignissim quis.</div>
        </div>
    </div>
</body>
</html>

效果图如下:

L~6[}X@MFAMV9]`78U)GMLC

2:配置项

2.1:active,初始化时,展开的项。

2.2:event,切换选项卡的事件,默认为click。(mouseover,鼠标滑过切换)

2.3:alwaysOpen,保证有一个选项是展开的。默认为true。

2.4:animated,设置动画效果。

2.5:autoHeight,各个选项的高度设置为所有内容中最高的高度。

2.6:clearStyle,折叠面板后自动清除 height 和 overflow 样式.

2.7:fillSpace,充满容器的高度,此时autoHeight无效。

2.8:header,设置头元素,$("#accordion").accordion({ header: "h3" });

2.9:navigation

2.10:navigationFilter

3:方法

3.1:destroy,销毁。$("#accordion").accordion("destroy");

3.2:enable和disable。$("#accordion").accordion("enable");和$("#accordion").accordion("disable");允许和禁止操作面板。

3.3:activate",打开指定的面板。$("#accordion").accordion("activate", choice - 1);

3.4:option,得到折叠面板的属性。

获取:var clearStyle = $("#id").accordion("option","clearStyle");

设置:$("#id").accordion("option","clearStyle",true);