Use different library instead of jQuery Mobile for <select>

不问归期 提交于 2019-12-13 07:19:35

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/30945760/use-different-library-instead-of-jquery-mobile-for-select

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!