简体   繁体   English

使用其他库代替jQuery Mobile <select>

[英]Use different library instead of jQuery Mobile for <select>

I've looked all over the place to try and find a way to somehow disable jQuery Mobile's selectmenu widget so that I can use a 3rd party library for a <select></select> . 我到处寻找可以找到某种方式禁用jQuery Mobile的selectmenu小部件的方法,这样我就可以为<select></select>使用第3方库。 In my case, I want to use the Chosen library. 就我而言,我想使用选择的库。 Is there any way I can do this, while still retaining the rest of the jQuery Mobile styling on my page? 有什么办法可以做到,同时仍保留页面上其余的jQuery Mobile样式?

You can tell jQM to ignore the select by adding data-role="none" 您可以通过添加data-role="none"来告诉jQM忽略选择

<select id="mySelect" data-role="none" placeholder="Select an option..." >
    <option value="">Select an option...</option> 
    <option value="1">Option 1</option>            
    <option value="2">Option 2</option>   
    <option value="3">Option 3</option>   
    <option value="4">Option 4</option>   
</select>

Here is a demo using the Selectize plugin for the select and other controls use jQM: 这是一个使用Selectize插件进行select和其他控件使用jQM的演示:

DEMO 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM