jQuery Mobile多选框 [英] jQuery Mobile multi-select box

查看:239
本文介绍了jQuery Mobile多选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,多选框并不是最好的输入词,但有时可能会很好.以我的jQuery mobile为例,他们创建了一个对话框,该对话框将页面与用户可以选择的所有选项覆盖在一起.

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>

好吧,现在的问题是我需要在此按钮的底部添加一个关闭按钮,因为列表是动态填充的,对于移动页面来说可能会很长.顶部只有一个关闭按钮,效果不是很好.有没有一种方法可以将页脚附加到使用multiselect创建的对话框中?我似乎在jQM API中找不到这个.

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.

推荐答案

除非您想疯狂地编辑其CSS,否则不要这么做.话虽如此,您可以添加关闭"作为选项,然后单击该对话框即可触发对话框关闭方法:

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

这篇关于jQuery Mobile多选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆