如何在整个div内容中禁用jquery mobile的样式? [英] How disable jquery mobile's style in the entire contents of a div?
问题描述
我正在研究jQuery Mobile的项目.
I work on a jQuery Mobile's project.
在页面中,我想使用mobilescroll
进行选择( http: //demo.mobiscroll.com/select#language=fr&display=inline )
In a page, I want use mobilescroll
for an select (http://demo.mobiscroll.com/select#language=fr&display=inline)
我尝试了data-role="none"
,但是对孩子们无效
和mobilescroll
创建自己的标签.
I try data-role="none"
, but it doesn't work on the children
and mobilescroll
create their own tags.
如何在div
的全部内容中禁用jQuery Mobile的样式?
How disable jQuery Mobile's style in the entire contents of a div
?
谢谢
推荐答案
可以防止jQuery Mobile增强元素.但是,采用此解决方案会使您的应用程序运行速度比平时慢.
It's possible to prevent jQuery Mobile from enhancing elements. however, following this solution will make your application slower than usual.
Demo
首先,您需要将 ignoreContentEnabled 全局设置为 true .
First, you need to globally set ignoreContentEnabled to true.
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).on("mobileinit", function(){
$.mobile.ignoreContentEnabled = true;
});
</script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
然后,将data-enhance="false"
属性添加到您不希望JQM增强的元素上.这就是app变慢的原因,因为JQM会检查所有元素中的该属性.
And then, add data-enhance="false"
attribute to elements which you don't want JQM to enhance. This is the reason why app becomes slow, because JQM checks for this attribute in all elements.
这篇关于如何在整个div内容中禁用jquery mobile的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!