有没有办法独立使用jQuery移动窗口小部件? [英] Any way to use jQuery mobile widgets independently?

查看:119
本文介绍了有没有办法独立使用jQuery移动窗口小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Twitter Bootstrap构建的网站,但我想将jQuery Mobile的手风琴小部件合并为可折叠的内容.我使用了他们的下载构建器,并且只选择了手风琴小部件.我认为问题在于核心jquery.mobile.js文件中仍然存在一些与bootstrap.js冲突的代码,因为它最终改变了我在导航菜单中链接的行为.它将每个常规链接都视为ajax请求,这确实与我的应用有关.

I have a site built using Twitter Bootstrap, but I'd like to incorporate jQuery Mobile's accordion widgets for collapsible content. I've used their download builder and selected only the accordion widget. I think the problem is there is still some code in the core jquery.mobile.js file that conflicts with bootstrap.js, because it ends up changing my links' behavior in the nav menu. It treats every regular link as an ajax request, which really screws with my app.

有人有使用jQuery mobile和Bootstrap的经验吗?有没有一种方法可以更改默认设置,以便仅操作手风琴小部件?还是该小部件有更好的移动友好替代方法?我衷心感谢我能为此提供的任何帮助!

Does anyone have experience with jQuery mobile and Bootstrap? Is there a way to change default settings so that only the accordion widget is manipulated? Or is there a better mobile-friendly alternative to that widget? I sincerely appreciate just about any help I can get on this!

推荐答案

我应该在不久前进行了更新.要禁用ajax,请运行:

I should have updated this a while ago. To disable ajax, run:

$.mobile.ajaxLinksEnabled = false;

这会将所有链接视为普通锚,使其与Bootstrap兼容.

This will cause all the links to be treated as normal anchors, making it compatible with Bootstrap.

这篇关于有没有办法独立使用jQuery移动窗口小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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