可折叠集的jQuery Mobile Custom下载无法正常工作/在加载时触发吗? [英] jQuery Mobile Custom download of collapsible set not working/triggering on load?

查看:98
本文介绍了可折叠集的jQuery Mobile Custom下载无法正常工作/在加载时触发吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jquery mobile的新手,如果这是一个愚蠢的问题,请原谅我.

Hi I am new to jquery mobile so forgive me if this is a stupid question.

我正在尝试在页面上实现可折叠集合.我已经使用下载生成器从jquery移动网站下载了一个自定义文件,只是选择了可折叠集合小部件,该小部件会自动选择我认为要包含的必要功能.

I'm trying to implement a collapsible set on my page. I have downloaded a custom file from the jquery mobile website using the download builder and just choosing the collapsible set widget, which automatically selects what I assume are the necessary functions to include.

我已经按照入门指南中的说明进行操作,将css文件和自定义js文件链接在一起,这些文件确实已经用Firebug检查过了.

I've followed the instructions on the getting started guide, linked the css files and the custom js file which do load I've checked with firebug.

我已经添加了适当的html标记,但是在页面加载时却无能为力.

I've added the appropriate html markup but it fails to do anything when the page loads.

如果我尝试使用整个Jquery mobile v.1.45文件,则可折叠集可以工作,但它会开始更改页面上的其他元素(例如表单按钮),这会干扰我的设计.如您所知,我不想这样做.

If I try using the entire Jquery mobile v.1.45 file then the collapsable set works but it starts altering other elements on my page like form buttons among other things, messing with my design. As you can understand I don't want it doing that.

我使用drupal构建了我的网站,我不知道这是否重要.

I've built my website using drupal I don't know if that matters.

有没有其他人经历过,这是一个错误,是否可以解决,我做错了什么吗?

Has anyone else experienced this, is this a bug, is there a work around, am I doing something drastically wrong?

任何帮助或建议将不胜感激.

Any help or suggestions would be appreciated.

我的标记很简单:

<div class="ui-collapsible-set field-items" data-corners="false" data-content-theme="a" data-theme="a" data-role="collapsibleset">

  <div class="field-item even" data-role="collapsible">
    <h2>Heading:</h2>
    <p> my text </p>
  </div>

  <div class="field-item even" data-role="collapsible">
    <h2>Heading:</h2>
    <p> my text </p>
  </div>

  <div class="field-item even" data-role="collapsible">
    <h2>Heading:</h2>
    <p> my text </p>
  </div>

</div>

推荐答案

由于它不是完整版本,因此任何小部件都不会自动初始化.因此,您需要手动初始化自定义窗口小部件.

Since it's not a full version, then any widget won't be initialized automatically. Therefore, you need to initialize custom widgets manually.

$(function() {
  $("#collapssible-set-ID").collapsibleset();
});

这篇关于可折叠集的jQuery Mobile Custom下载无法正常工作/在加载时触发吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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