Jquery mobile 需要使用jQuery mobile制作不可折叠部分的帮助吗 第一节

Jquery mobile 需要使用jQuery mobile制作不可折叠部分的帮助吗 第一节,jquery-mobile,Jquery Mobile,我是第一节的可折叠集合内容 第二节 我是第2节的可折叠集合内容 只读第3节 使用上述模式,我想在协作集中创建一些仅带标题的div,并且由于某些要求,我想使它们不可折叠。如果有人知道这方面的任何信息,请告诉我内容的折叠/扩展正在可折叠标题的单击处理程序中处理。因此,通过解除单击事件的绑定,您可以保持accordion始终处于展开状态 <div data-role="collapsible-set"> <div data-role="collapsible" data-

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

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

只读第3节
使用上述模式,我想在
协作集
中创建一些仅带标题的div,并且由于某些要求,我想使它们不可折叠。如果有人知道这方面的任何信息,请告诉我内容的折叠/扩展正在可折叠标题的
单击处理程序中处理。因此,通过解除
单击事件的绑定,您可以保持accordion始终处于展开状态

<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> <!--I tried this but this only makes simple heading without any background style used for other collapsible section headings-->
        <h3>Read only Section 3</h3>
    </div>        

</div>
这里有一个演示-

编辑

编辑提琴,使一些始终处于展开状态-

添加了一个属性
data allow collapse
。对于要允许折叠的部分,将其设置为
true
。对于其他部分
false

以下是完整的源代码:

$(".ui-collapsible-heading").unbind("click");

jQuery移动示例
$(“#page”).live('pageinit',函数(事件){
$(“.ui可折叠[数据允许折叠=假]”)。取消绑定(“展开折叠”);
});
页面标题
第1节-不允许

我是B部分的可折叠集合内容。

第2-2节允许 我是B部分的可折叠集合内容。

第3-3节允许 我是B部分的可折叠集合内容。

第4节-不允许 我是B部分的可折叠集合内容。


内容的折叠/展开正在可折叠标题的
单击处理程序中处理。因此,通过解除
单击事件的绑定,您可以保持accordion始终展开

<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> <!--I tried this but this only makes simple heading without any background style used for other collapsible section headings-->
        <h3>Read only Section 3</h3>
    </div>        

</div>
这里有一个演示-

编辑

编辑提琴,使一些始终处于展开状态-

添加了一个属性
data allow collapse
。对于要允许折叠的部分,将其设置为
true
。对于其他部分
false

以下是完整的源代码:

$(".ui-collapsible-heading").unbind("click");

jQuery移动示例
$(“#page”).live('pageinit',函数(事件){
$(“.ui可折叠[数据允许折叠=假]”)。取消绑定(“展开折叠”);
});
页面标题
第1节-不允许

我是B部分的可折叠集合内容。

第2-2节允许 我是B部分的可折叠集合内容。

第3-3节允许 我是B部分的可折叠集合内容。

第4节-不允许 我是B部分的可折叠集合内容。


或者您可以使用此代码,直到节框角色可用:

<!DOCTYPE html>
<html>
    <head>
        <title>jQuery Mobile Sample</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script>
            $("#page").live('pageinit', function(event) {
                $(".ui-collapsible[data-allow-collapse=false]").unbind("expand collapse");
            });
        </script>
        <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="page">
            <div data-role="header">
                <h1>Page Title</h1>
            </div><!-- /header -->
            <div data-role="content">
                <div data-role="collapsible-set">
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="false">
                        <h3>Section 1-Not allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="true">
                        <h3>Section 2-Allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="true">
                        <h3>Section 3-Allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="false">
                        <h3>Section 4-Not allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                </div>
            </div><!-- /content -->
        </div><!-- /page -->
    </body>
</html>

标题
内容

或者您可以使用此代码,直到节框角色可用:

<!DOCTYPE html>
<html>
    <head>
        <title>jQuery Mobile Sample</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script>
            $("#page").live('pageinit', function(event) {
                $(".ui-collapsible[data-allow-collapse=false]").unbind("expand collapse");
            });
        </script>
        <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="page">
            <div data-role="header">
                <h1>Page Title</h1>
            </div><!-- /header -->
            <div data-role="content">
                <div data-role="collapsible-set">
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="false">
                        <h3>Section 1-Not allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="true">
                        <h3>Section 2-Allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="true">
                        <h3>Section 3-Allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                    <div data-role="collapsible" data-collapsed="false" data-allow-collapse="false">
                        <h3>Section 4-Not allowed</h3>
                        <p>
                            I'm the collapsible set content for section B.
                        </p>
                    </div>
                </div>
            </div><!-- /content -->
        </div><!-- /page -->
    </body>
</html>

标题
内容
您可以执行以下操作:

<div class="ui-collapsible ui-body-c">
    <h3 class="ui-collapsible-heading">
        <span style="margin:0; cursor:auto;" class="ui-btn ui-corner-top ui-btn-up-a">
            <span class="ui-corner-top ui-corner-bottom" style="display:block; padding: .6em 5px">Title
            </span>
        </span>
    </h3>
    <div class="ui-collapsible-content ui-body-c ui-corner-bottom">
        <div>Content
        </div>
    </div>
</div>
您可以这样做:

<div class="ui-collapsible ui-body-c">
    <h3 class="ui-collapsible-heading">
        <span style="margin:0; cursor:auto;" class="ui-btn ui-corner-top ui-btn-up-a">
            <span class="ui-corner-top ui-corner-bottom" style="display:block; padding: .6em 5px">Title
            </span>
        </span>
    </h3>
    <div class="ui-collapsible-content ui-body-c ui-corner-bottom">
        <div>Content
        </div>
    </div>
</div>

到目前为止你试过什么?有没有编写的代码要共享?如果你懒得尝试,那么为什么有人要费心回答……我做了一些修改,请参见第C节到目前为止你尝试了什么?有没有编写的代码要共享?如果你懒得去尝试,那为什么有人要费心回答呢?…我做了一些修改,请看C部分这是我需要做的。如果我想保持一个部分可折叠(不是永久性的),而另一个部分不可折叠(永久性的),该怎么办?这就是我需要做的。如果我想让其中一个部分可折叠(不是永久性的),而其他部分不可折叠(永久性的),该怎么办?