JQuery Mobile Select Box无法正常工作 [英] JQuery Mobile Select Box not working

查看:83
本文介绍了JQuery Mobile Select Box无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这有点疯狂。
我现在已经尝试了几个小时的代码而没有运气:

This is getting a bit crazy. I have been trying the code for hours now and no luck:

<div data-role="fieldcontain">
    <label for="select-choice-1" class="select">Choose shipping method:</label>
    <select name="select-choice-1" id="select-choice-1">
        <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>

来自:

http://jquerymobile.com/demos/1.0a4.1/#docs /forms/forms-selects.html

当我在手机上测试时,没有下拉列表......实际上,根本没有任何问题。

When I test it on my mobile there is no dropdown ... actually, nothing hapens at all.

我忘记了什么?

推荐答案

如果你看一下您可以在表单标签中看到它的网页来源:

If you look at the source of the web page you can see it's in a form tag:

<form action="#" method="get">

因此,在表格标签之间添加此项将获得所需的结果:实例链接

So Adding this between the form tags would get the desired results: Live Example Link

<form action="#" method="get">
    <div data-role="fieldcontain">
        <label for="select-choice-1" class="select">Choose shipping method:</label>
        <select name="select-choice-1" id="select-choice-1">
            <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>
</form>

可能出现另一个问题:

尝试将此标记添加到下拉列表中:实例链接

Try adding this tag to the dropdown: Live Example Link

data-native-menu="false" 

这篇关于JQuery Mobile Select Box无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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