Jquery mobile JQuery Mobile在单击图标时展开/折叠?

Jquery mobile JQuery Mobile在单击图标时展开/折叠?,jquery-mobile,Jquery Mobile,有人知道如何只在CollapseBe div中单击图标来实现展开/折叠吗?试试jQM。您只需将数据角色=可折叠添加到div,例如: <div data-role="collapsible"> <h3>I'm a header</h3> <p> I'm the collapsible content. By default I'm closed, but you can click the header to o

有人知道如何只在CollapseBe div中单击图标来实现展开/折叠吗?

试试jQM。您只需将数据角色=可折叠添加到div,例如:

<div data-role="collapsible">
   <h3>I'm a header</h3>
   <p>
      I'm the collapsible content. 
      By default I'm closed, but you can click the header to open me.
   </p>
</div>
我找到了以下方法:

...
                collapsibleHeading.find(".ui-icon").bind("click", function (event) {
                    var type = collapsibleHeading.is(".ui-collapsible-heading-collapsed") ?
                                                                                "expand" :                "collapse";

                    collapsible.trigger(type);

                    event.preventDefault();
                });

如果您需要更多详细信息,请告诉我。

我的意思是单击图标。不要单击div标题。