jQuery Mobile可折叠内容 [英] Jquery Mobile Collapsible Content

查看:103
本文介绍了jQuery Mobile可折叠内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
动态添加可折叠元素

Possible Duplicate:
Dynamically adding collapsible elements

我想在需要之一中使用Jquery移动可折叠内容,即手风琴功能. 当我尝试使用如下所述的可折叠内容集

I would like to use the Jquery mobile collapsible content i.e., Accordion functionality in one of my requirement. when I am trying to use the collapsible content set as mentioned below

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

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

并导入了jquery.mobile-1.0b2.min.css,jquery-1.6.2.min.js,jquery.mobile-1.0b2.min.js

and imported jquery.mobile-1.0b2.min.css,jquery-1.6.2.min.js,jquery.mobile-1.0b2.min.js

我只想使用手风琴的折叠和扩展功能.但是当我使用上述内容时,它通过添加jquery mobile的css改变了整个页面的布局,这对我来说不是必需的.

I just wanted to use the collapsing and expanding functionality of the accordion. But when I use the above content its changing the entire page layout by adding the css of jquery mobile which is not required for me.

我在页面上还有几个链接,这些链接会将我重定向到不同的页面,但是在包含jQuery mobile CSS之后,如果单击这些链接,它将打开现有页面下方的页面.

Also I have few more links on the page which will redirect me to different pages but after including the jquery mobile CSS if I click on those links it opens the page below the existing page.

我想知道是否有任何jquery移动插件,以便我只能使用手风琴的功能而忽略其他功能?

I would like to know is there any jquery mobile plugin such that I can use only the functionality of accordion and ignoring the other functionalities?

推荐答案

您将必须使用例如,为避免自动初始化,将autoInitializePage设置为false将阻止页面的自动初始化.将ajaxEnabled设置为false可能会解决您的链接问题,但是我不确定.

For example to avoid the autoinit, setting autoInitializePage to false will prevent the auto initialization of the page. Settign the ajaxEnabled setting to false might deal with your link problem, but I'm not sure about that.

要在防止使用默认的init格式后正确初始化div,您必须使用指定的$("a way to select your div").trigger('create');之类的东西

To initialize your div correctly after preventing the default init formating, you'll have to use something like $("a way to select your div").trigger('create'); as specified here

这篇关于jQuery Mobile可折叠内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆