问题
I am using a grouped select to achive my desired interface...two questions:
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">
Any ideas on how I might accomplish these tasks in 1.4???
Regards, Alex
回答1:
You can tell jQuery Mobile to not auto-initialize any widget with a specific tag name, id or a class.
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>
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
来源:https://stackoverflow.com/questions/20851624/jqm-select-pre-render