jQuery Mobile multi-select box

感情迁移 提交于 2019-12-06 09:06:29

问题


So multi-select boxes aren't the nicest inputs to work with in the word, but they can sometimes be good. In my case for jQuery mobile they create a dialog box that overlays the page with all the options the user can select.

<div data-role="fieldcontain">
    <label for="select-choice-1" class="select">Choose shipping method:</label>
    <select name="select-choice-1" id="select-choice-1" multiple="multiple">
        <option value="standard">Standard: 7 day</option>
        <option value="rush">Rush: 3 days</option>
        <option value="express">Express: next day</option>
        <option value="overnight">Overnight</option>
    </select>
</div>

Ok now the issue I am having is that I need to add a close button on the bottom of this because the list is dynamically populated can get very long for a mobile page. With only a close button at the top it's not very good. Is there a way to append a footer to the dialog box created with multiselect? I can't seem to find this in the jQM API.


回答1:


Not unless you want to go crazy editing their CSS. That being said, you could add Close as an option, then trigger the dialog close method if it is clicked:

http://jquerymobile.com/demos/1.1.0-rc.1/docs/forms/selects/methods.html



来源:https://stackoverflow.com/questions/10004719/jquery-mobile-multi-select-box

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