简体   繁体   中英

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> . 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?

You can tell jQM to ignore the select by adding data-role="none"

<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:

DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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