jQM选择预渲染? [英] jQM select pre-render?
问题描述
我正在使用分组选择来实现所需的界面...两个问题:
I am using a grouped select to achive my desired interface...two questions:
-
在实际显示选择列表之前,我需要截取DOM,因为在注入的SPAN中有jQM添加的文本,我想通过将一些较小的文本包装在标签中以进一步提高视敏度来进一步增强这些文本.
I need to intercept the DOM before actually showing the list of selects because there is text in the injected SPAN that jQM adds which I want to further enhance by wrapping some minor text in tags for better visual acuity.
在给出此代码的情况下,选择控件似乎无法全宽显示.
The select controls will not seem to go full width given this code.
<fieldset data-role="controlgroup" data-mini="true">
关于如何在1.4中完成这些任务的任何想法?
Any ideas on how I might accomplish these tasks in 1.4???
关于, 亚历克斯
推荐答案
您可以告诉jQuery Mobile不要自动初始化具有特定标签名称,id或类的任何小部件.
You can tell jQuery Mobile to not auto-initialize any widget with a specific tag name, id or a class.
将代码放在下面的标题中,在jQuery.js之后和jQuery Mobile之前.
Place the code below in head, after jQuery.js and before jQuery Mobile.
<head>
<!-- jQuery.js -->
<script>
$(document).on("mobileinit", function () {
$.mobile.keepNative = ".native"; /* jQM 1.4 */
});
</script>
<!-- jQM.js -->
</head>
现在,将类native
添加到select
,以阻止JQM在启动时对其进行增强.
Now, add class native
to select
, to stop JQM from enhancing it on startup.
进行所需的任何更改,然后手动进行增强.
Do whatever changes you want and then enhance it manually.
$("select").removeClass("native").selectmenu();
Demo
这篇关于jQM选择预渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!