Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何自动打开第一个折叠集(手风琴)?_Jquery_Jquery Mobile - Fatal编程技术网

Jquery 如何自动打开第一个折叠集(手风琴)?

Jquery 如何自动打开第一个折叠集(手风琴)?,jquery,jquery-mobile,Jquery,Jquery Mobile,我有一个可折叠集,当页面加载时,我想自动打开第一个可折叠集 我在jquerymobile中是如何做到这一点的?从中可以使用数据折叠=false <div data-role="collapsible-set"> <div data-role="collapsible" data-collapsed="false"> <h3>Section 1</h3> <p>I'm the collapsible set co

我有一个可折叠集,当页面加载时,我想自动打开第一个可折叠集

我在jquerymobile中是如何做到这一点的?

从中可以使用
数据折叠=false

<div data-role="collapsible-set">

    <div data-role="collapsible" data-collapsed="false">
    <h3>Section 1</h3>
    <p>I'm the collapsible set content for section 1.</p>
    </div>

    <div data-role="collapsible">
    <h3>Section 2</h3>
    <p>I'm the collapsible set content for section 2.</p>
    </div>
</div>

第一节
我是第一节的可折叠集合内容

第二节 我是第2节的可折叠集合内容


您也可以通过
pageinit
事件上的代码来完成:

$("#myCollapsibleSet").children(":first").trigger("expand");

假设
#myCollapsibleSet
是可折叠集合的ID。

首先
可折叠
可折叠